Commit 5667638c by Ian Lance Taylor

Check for identical package name and prefix in imported package.

From-SVN: r168494
parent 3ebb5ca6
......@@ -332,6 +332,12 @@ Gogo::import_package(const std::string& filename,
Package* package = imp.import(this, local_name, is_local_name_exported);
if (package != NULL)
{
if (package->name() == this->package_name()
&& package->unique_prefix() == this->unique_prefix())
error_at(location,
("imported package uses same package name and prefix "
"as package being compiled (see -fgo-prefix option)"));
this->imports_.insert(std::make_pair(filename, package));
package->set_is_imported();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment