diff mbox

[C++] PR 50371

Message ID 4E7B6F29.3080200@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Sept. 22, 2011, 5:23 p.m. UTC
Hi,

I have this patchlet for a simple C++11 rejects-valid, reported by 
Daniel. Tested x86_64-linux.

Ok for mainline?

Thanks,
Paolo.

////////////////////
/cp
2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50371
	* pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.

/testsuite
2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50371
	* g++.dg/cpp0x/nullptr24.C: New.

Comments

Jason Merrill Sept. 22, 2011, 6:06 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: testsuite/g++.dg/cpp0x/nullptr24.C
===================================================================
--- testsuite/g++.dg/cpp0x/nullptr24.C	(revision 0)
+++ testsuite/g++.dg/cpp0x/nullptr24.C	(revision 0)
@@ -0,0 +1,5 @@ 
+// PR c++/50371
+// { dg-options -std=c++0x }
+
+template<decltype(nullptr)>
+struct nt;
Index: cp/pt.c
===================================================================
--- cp/pt.c	(revision 179088)
+++ cp/pt.c	(working copy)
@@ -18717,6 +18717,8 @@  invalid_nontype_parm_type_p (tree type, tsubst_fla
     return 0;
   else if (TREE_CODE (type) == DECLTYPE_TYPE)
     return 0;
+  else if (TREE_CODE (type) == NULLPTR_TYPE)
+    return 0;
 
   if (complain & tf_error)
     error ("%q#T is not a valid type for a template constant parameter", type);