https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66892
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Alias| |cwg355 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- testcase: struct A; struct ::A { }; namespace B { struct A; } struct ::B::A { }; Looks the error message was added with the new parser in GCC 3.4.0. The fix might be easy but I have not tested it to see if there is any regressions. That is remove the following code from parser.c: /* Issue the error about the overly-qualified name now. */ if (qualified_p) { cp_parser_error (parser, "global qualification of class name is invalid"); type = error_mark_node; goto out; } else