summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-12 19:25:29 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-12 19:25:29 +0000
commitf8dda2a530558b2e4c1b8c71aa4ed78dd38da577 (patch)
tree3033c8b60a5e9cc086ca249c93daa2ac296c3284
parent55632bcdfdc7eceab5d69f95244a7e26d09198b7 (diff)
downloadgcc-f8dda2a530558b2e4c1b8c71aa4ed78dd38da577.tar.gz
compiler: Don't permit importing a package as "init".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205938 138bc75d-0d04-0410-961f-82ee72b054a4
-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);