DR1206 allows explicit specializations of member enumerations
of class templates, so just remove the pedwarn about it.

Tested on Linux-x64. Not bootstrapped.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d267a5c..97eadeb 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -967,11 +967,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 }; 

Attachment: pr61491.changelog
Description: Binary data

Reply via email to