Fix second import of package using _.
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Mar 2011 21:29:46 +0000 (21:29 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Mar 2011 21:29:46 +0000 (21:29 +0000)
From-SVN: r170755

gcc/go/gofrontend/gogo.cc

index 52370499f45e7d798fabc55251870b9ded4a813f..69ad3981765a6ca335ea6d52ed8e53dfbd3d137a 100644 (file)
@@ -308,12 +308,7 @@ Gogo::import_package(const std::string& filename,
          ln = package->name();
          is_ln_exported = Lex::is_exported_name(ln);
        }
-      if (ln != ".")
-       {
-         ln = this->pack_hidden_name(ln, is_ln_exported);
-         this->package_->bindings()->add_package(ln, package);
-       }
-      else
+      if (ln == ".")
        {
          Bindings* bindings = package->bindings();
          for (Bindings::const_declarations_iterator p =
@@ -322,6 +317,13 @@ Gogo::import_package(const std::string& filename,
               ++p)
            this->add_named_object(p->second);
        }
+      else if (ln == "_")
+       package->set_uses_sink_alias();
+      else
+       {
+         ln = this->pack_hidden_name(ln, is_ln_exported);
+         this->package_->bindings()->add_package(ln, package);
+       }
       return;
     }