https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102004
Bug ID: 102004 Summary: The opaque-enum-declaration whose enum-head-name contains a nest-name-specifier should be permitted in an explicit specialization Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: xmh970252187 at gmail dot com Target Milestone: --- template<class T> struct A{ enum C:T; }; template<> enum A<int>::C:int; This explicit specialization should be accepted by comfort implementations. Since the standard only says that > If the enum-head-name of an opaque-enum-declaration contains a > nested-name-specifier, the declaration shall be an explicit specialization. Clang accepts this example while GCC rejects it with the diagnosis "opaque-enum-specifier must use a simple identifier". https://godbolt.org/z/zYG4sYbK6