This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61491] New: An explicit specialization of a member enumeration of a class template is rejected
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jun 2014 21:41:48 +0000
- Subject: [Bug c++/61491] New: An explicit specialization of a member enumeration of a class template is rejected
- Auto-submitted: auto-generated
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.