[Bug c++/61491] New: An explicit specialization of a member enumeration of a class template is rejected
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 12 21:41:00 GMT 2014
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.
More information about the Gcc-bugs
mailing list