From b4ed59860a2fa536620e9b0b7bb6b3851fd6911c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 7 Mar 2011 21:29:46 +0000 Subject: [PATCH] Fix second import of package using _. From-SVN: r170755 --- gcc/go/gofrontend/gogo.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 52370499f45..69ad3981765 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -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; } -- 2.30.2