re PR c++/50371 ([C++0x] std::nullptr_t rejected as non-type template-parameter)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 22 Sep 2011 18:20:53 +0000 (18:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 22 Sep 2011 18:20:53 +0000 (18:20 +0000)
/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.

From-SVN: r179096

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nullptr24.C [new file with mode: 0644]

index 0dd01d9..8ec7a05 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50371
+       * pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
+
 2011-09-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
            Paolo Carlini  <paolo.carlini@oracle.com>
 
index ee33daf..af5ca5c 100644 (file)
@@ -18717,6 +18717,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
     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);
index b9d638f..90fe936 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50371
+       * g++.dg/cpp0x/nullptr24.C: New.
+
 2011-09-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/50482
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr24.C b/gcc/testsuite/g++.dg/cpp0x/nullptr24.C
new file mode 100644 (file)
index 0000000..f391779
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/50371
+// { dg-options -std=c++0x }
+
+template<decltype(nullptr)>
+struct nt;