compiler: Don't permit importing a package as "init".
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Dec 2013 19:25:29 +0000 (19:25 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Dec 2013 19:25:29 +0000 (19:25 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205938 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index e16b0d3..045763c 100644 (file)
@@ -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);