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.
case CPP_OPEN_PAREN:
case CPP_CLOSE_PAREN:
case CPP_COMMA:
+ case CPP_SCOPE:
want_semicolon = false;
break;
--- /dev/null
+// PR c++/90107
+// { dg-do compile }
+
+struct A;
+namespace N { extern A a; }
+struct A {} ::N::a;
+
+struct A1;
+struct B { static A1 a1; };
+struct A1 {} ::B::a1;