https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84026

            Bug ID: 84026
           Summary: invalid 'unnamed scoped enum is not allowed' when
                    scoped enum has a full qualified-id
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: smw at gcc dot gnu.org
  Target Milestone: ---

On GCC (all versions tested, up to and including 8.0.1 20180117 with -std=c++14
-pedantic) but not o nMSVC, ICC, or clang, the following code

    struct S1 {
      enum class E1;
    };
    enum class S1::E1 {}; // OK

    struct S2 {
      enum class E2;
    };
    enum class ::S1::E1 {}; // Not OK

spits out the following error.

9 : <source>:9:16: error: unnamed scoped enum is not allowed
     enum class ::S1::E1 {}; // Not OK
                ^~
9 : <source>:9:10: warning: elaborated-type-specifier for a scoped enum must
not use the 'class' keyword
     enum class ::S1::E1 {}; // Not OK
     ~~~~ ^~~~~
          -----
9 : <source>:9:25: error: expected unqualified-id before '{' token
     enum class ::S1::E1 {}; // Not OK
                         ^
Looks like it's not quite parsing correctly.

Reply via email to