OSDN Git Service

Fix second import of package using _.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Mar 2011 21:29:46 +0000 (21:29 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Mar 2011 21:29:46 +0000 (21:29 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170755 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index 5237049..69ad398 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;
     }