https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65558
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- If it is correct to ignore the abi_tag on an anonymous namespace (docs say "The ABI tags apply to a name..."), then: --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3663,6 +3663,12 @@ handle_namespace_attrs (tree ns, tree attributes) "namespace", name); continue; } + if (!DECL_NAME (ns)) + { + warning (OPT_Wattributes, "ignoring %qD attribute on anonymous " + "namespace", name); + continue; + } if (!args) { tree dn = DECL_NAME (ns);