===================================================================
@@ -970,11 +970,10 @@ maybe_process_partial_specialization (tree type)
}
else if (processing_specialization)
{
- /* Someday C++0x may allow for enum template specialization. */
+ /* Under DR 1206 enum template specializations are allowed. */
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
{
error ("explicit specialization of non-template %qT", type);
===================================================================
@@ -0,0 +1,20 @@
+// PR c++/61491
+// { dg-do compile { target c++11 } }
+
+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) {}
+};
+
+X x;