re PR c++/53882 (ICE in type_contains_placeholder_1, at tree.c:3015)
authorJason Merrill <jason@redhat.com>
Mon, 9 Jul 2012 14:11:01 +0000 (10:11 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 9 Jul 2012 14:11:01 +0000 (10:11 -0400)
PR c++/53882
* tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE.
(type_hash_eq): Likewise.

From-SVN: r189386

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nullptr29.C [new file with mode: 0644]
gcc/tree.c

index 2b0ebab4002f349c95f2e7c05cd1fe84909ee627..3e8bfc236c73bdb723a733077aa06b0de198f400 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-09  Jason Merrill  <jason@redhat.com>
+
+       PR c++/53882
+       * tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE.
+       (type_hash_eq): Likewise.
+
 2012-07-09  Tom de Vries  <tom@codesourcery.com>
            Richard Guenther  <rguenther@suse.de>
 
index fd233516f967de23d993f4d2f8439d5d88b60558..07187ebe3d257a5bebb0133d7ea7147d1f42f138 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-09  Jason Merrill  <jason@redhat.com>
+
+       PR c++/53882
+       * g++.dg/cpp0x/nullptr29.C: New.
+
 2012-07-09  Tom de Vries  <tom@codesourcery.com>
            Richard Guenther  <rguenther@suse.de>
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr29.C b/gcc/testsuite/g++.dg/cpp0x/nullptr29.C
new file mode 100644 (file)
index 0000000..a8e35a9
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/53882
+// { dg-options "-std=gnu++11 -O" }
+
+void f(decltype(nullptr) &__restrict np) { }
index 9be0c9a7e31522809ce578f360ca2652071f5ccd..f92f0704619419c64442221b0bbe1afcb48805b8 100644 (file)
@@ -2980,6 +2980,7 @@ type_contains_placeholder_1 (const_tree type)
     case METHOD_TYPE:
     case FUNCTION_TYPE:
     case VECTOR_TYPE:
+    case NULLPTR_TYPE:
       return false;
 
     case INTEGER_TYPE:
@@ -6188,6 +6189,7 @@ type_hash_eq (const void *va, const void *vb)
     case COMPLEX_TYPE:
     case POINTER_TYPE:
     case REFERENCE_TYPE:
+    case NULLPTR_TYPE:
       return 1;
 
     case VECTOR_TYPE: