On 13 June 2014 01:37, Ville Voutilainen <ville.voutilai...@gmail.com> wrote: > DR1206 allows explicit specializations of member enumerations > of class templates, so just remove the pedwarn about it. > > Tested on Linux-x64. Not bootstrapped.
Argh, also remove the old comment, new patch attached.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d267a5c..507585f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -966,12 +966,8 @@ maybe_process_partial_specialization (tree type) } else if (processing_specialization) { - /* Someday C++0x may allow for enum template specialization. */ - if (cxx_dialect > cxx98 && TREE_CODE (type) == ENUMERAL_TYPE - && CLASS_TYPE_P (context) && CLASSTYPE_USE_TEMPLATE (context)) - pedwarn (input_location, OPT_Wpedantic, "template specialization " - "of %qD not allowed by ISO C++", type); - else + if (!(cxx_dialect > cxx98 && TREE_CODE (type) == ENUMERAL_TYPE + && CLASS_TYPE_P (context) && CLASSTYPE_USE_TEMPLATE (context))) { error ("explicit specialization of non-template %qT", type); return error_mark_node; diff --git a/gcc/testsuite/g++.dg/cpp0x/pr61491.C b/gcc/testsuite/g++.dg/cpp0x/pr61491.C new file mode 100644 index 0000000..c105782 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr61491.C @@ -0,0 +1,12 @@ +// { dg-do compile { target c++11 } } +// { dg-options "-pedantic" } +// DR 1206 (explicit specialization of a member enumeration of a class template) + +template <class D> struct Base +{ + enum class E : unsigned; +}; + +struct X; + +template<> enum class Base<X>::E : unsigned { a, b };