The following core language defect has status c++11 but is not implemented yet: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355 Without implementing this fix gcc doesn't fully support c++11 syntax.
The DR says GCC didn't warn back in 2002, but this has been rejected since at least 4.3.6 so we must have changed it, in the wrong direction.
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
*** Bug 95610 has been marked as a duplicate of this bug. ***
Since the defect report says it work in GCC at the time I am going to assume this actually did and it was introduced by the new parser so this is a regression.
GCC 9 branch is being closed
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
GCC 10 branch is being closed.
GCC 11 branch is being closed.
is anyone working on this? seems like a minor fix. I can volunteer to fix this.
It wasn't assigned to anybody, and nobody's touched it for years, so I assume nobody was working on it.
I wonder if it's really as simple as just removing the cp_parser_error. The C++11 change that resolved the issue is https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3259.htm and that looks more involved, if we wanted to accurately follow the correct grammar.