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.carl...@oracle.com>
PR c++/50371
* pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
/testsuite
2011-09-22 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/50371
* g++.dg/cpp0x/nullptr24.C: New.
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);