https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61491
Bug ID: 61491 Summary: An explicit specialization of a member enumeration of a class template is rejected Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com #include <iostream> template <class D> struct Base { enum class E : unsigned; E e; Base(E e) : e(e) {} }; struct X; template<> enum class Base<X>::E : unsigned { a, b }; struct X : Base<X> { X() : Base<X>(E::b) {} }; int main() { X x; std::cout << static_cast<unsigned>(x.e) << std::endl; } [ville@localhost ~]$ g++ --std=c++11 -pedantic -o plash plash.cpp plash.cpp:12:52: warning: template specialization of ‘enum class Base<X>::E’ not allowed by ISO C++ [-Wpedantic] template<> enum class Base<X>::E : unsigned { a, b }; ^ Clang accepts the code.