diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index e16b0d3a59e6a025bbc690090ca055d30643ce2f..045763c7bee86360ec8494c07346d57b7fa60275 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);