From patchwork Tue Jun 22 20:35:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [gccgo] Fix bug importing package with same name as current package From: Ian Taylor X-Patchwork-Id: 56566 Message-Id: To: gcc-patches@gcc.gnu.org Date: Tue, 22 Jun 2010 13:35:51 -0700 This patch fixes a bug when importing a package whose name is the same as the current package, but which lives in a different directory. Committed to gccgo branch. Ian diff -r fafa9c01a826 go/gogo.cc --- a/go/gogo.cc Tue Jun 22 11:37:46 2010 -0700 +++ b/go/gogo.cc Tue Jun 22 13:31:02 2010 -0700 @@ -443,7 +443,8 @@ { // FIXME: Now that we compile packages as a whole, should we permit // importing the current package? - if (this->package_name() == real_name) + if (this->package_name() == real_name + && this->unique_prefix() == unique_prefix) { *padd_to_globals = false; if (!alias_arg.empty() && alias_arg != ".")