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;
export module foo;
namespace std {
- enum class align_val_t : decltype(sizeof(int)) {}; // { dg-error "conflicts with builtin" }
+ enum class align_val_t : decltype(sizeof(int)) {}; // { dg-error "in module .foo. conflicts with builtin" }
}
// { dg-prune-output "not writing module" }