aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/module.cc')
-rw-r--r--gcc/cp/module.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 6cd7d9e..3f8f84b 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -19140,7 +19140,13 @@ module_may_redeclare (tree olddecl, tree newdecl)
decl = newdecl ? newdecl : olddecl;
location_t loc = newdecl ? DECL_SOURCE_LOCATION (newdecl) : input_location;
if (DECL_IS_UNDECLARED_BUILTIN (olddecl))
- error_at (loc, "declaration %qD conflicts with builtin", decl);
+ {
+ if (newdecl_attached_p)
+ error_at (loc, "declaring %qD in module %qs conflicts with builtin "
+ "in global module", decl, new_mod->get_flatname ());
+ else
+ error_at (loc, "declaration %qD conflicts with builtin", decl);
+ }
else if (DECL_LANG_SPECIFIC (old_inner) && DECL_MODULE_IMPORT_P (old_inner))
{
auto_diagnostic_group d;