diff mbox

[C++] PR 61491 (aka DR 1206)

Message ID 559E9CB3.3070102@oracle.com
State New
Headers show

Commit Message

Paolo Carlini July 9, 2015, 4:09 p.m. UTC
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.carlini@oracle.com>

	PR c++/61491
	* pt.c (maybe_process_partial_specialization): Allow enum template
	specializations.

/testsuite
2015-07-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/61491
	* g++.dg/cpp0x/enum30.C: New.

Comments

Jason Merrill July 9, 2015, 4:33 p.m. UTC | #1
On 07/09/2015 12:09 PM, Paolo Carlini wrote:
> 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.

How about adding the testcase from the DR as well?  OK with that change.

Jason
diff mbox

Patch

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;