Hi,
the DR got resolved in time for C++11 and Jonathan noticed that we
should remove the pedwarn, not a big deal. Tested x86_64-linux.
Thanks,
Paolo.
//////////////////
/cp
2015-07-09 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/61491
* pt.c (maybe_process_partial_specialization): Allow enum template
specializations.
/testsuite
2015-07-09 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/61491
* g++.dg/cpp0x/enum30.C: New.
Index: cp/pt.c
===================================================================
--- cp/pt.c (revision 225614)
+++ cp/pt.c (working copy)
@@ -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);
Index: testsuite/g++.dg/cpp0x/enum30.C
===================================================================
--- testsuite/g++.dg/cpp0x/enum30.C (revision 0)
+++ testsuite/g++.dg/cpp0x/enum30.C (working copy)
@@ -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;