This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH for c++/53882 (ICE with bind, nullptr and -O)


We also need to handle NULLPTR_TYPE in type_contains_placeholder. While I was at it, I added a NULLPTR_TYPE case to type_hash_eq just in case.

Tested x86_64-pc-linux-gnu, applying to trunk and 4.7.
commit 05eb87b7123c9161268a0ef89b160c489a3d4935
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jul 9 15:39:06 2012 +0200

    	PR c++/53882
    	* tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE.
    	(type_hash_eq): Likewise.

diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr29.C b/gcc/testsuite/g++.dg/cpp0x/nullptr29.C
new file mode 100644
index 0000000..a8e35a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr29.C
@@ -0,0 +1,4 @@
+// PR c++/53882
+// { dg-options "-std=gnu++11 -O" }
+
+void f(decltype(nullptr) &__restrict np) { }
diff --git a/gcc/tree.c b/gcc/tree.c
index 9be0c9a..f92f070 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]