https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90107
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:851031b2fcd5210b96769c440db10130478d273c commit r12-8304-g851031b2fcd5210b96769c440db10130478d273c Author: Marek Polacek <pola...@redhat.com> Date: Wed Apr 27 18:17:54 2022 -0400 c++: global-namespace-qualified var after class def [PR90107] Here we wrongly reject the definition of "::N::a" struct A; namespace N { extern A a; } struct A {} ::N::a; because our code to diagnose a missing ; after a class definition doesn't realize that :: can follow a class definition. PR c++/90107 gcc/cp/ChangeLog: * parser.cc (cp_parser_class_specifier_1): Accept :: after a class definition. gcc/testsuite/ChangeLog: * g++.dg/parse/qualified6.C: New test.