aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2013-12-12 19:25:29 +0000
committerIan Lance Taylor <iant@google.com>2013-12-12 19:25:29 +0000
commit6d7497c7b106b5e2567273a3d64ce440979edb5b (patch)
tree3033c8b60a5e9cc086ca249c93daa2ac296c3284 /gcc/go
parent49ead48087eac3c0a733bd571d2f9f0c8ea3b644 (diff)
compiler: Don't permit importing a package as "init".
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@205938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/gogo.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index e16b0d3a59e..045763c7bee 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -440,6 +440,9 @@ Gogo::import_package(const std::string& filename,
return;
}
+ if (local_name == "init")
+ error_at(location, "cannot import package as init");
+
if (filename == "unsafe")
{
this->import_unsafe(local_name, is_local_name_exported, location);