diff mbox

C++ PATCH for c++/51530 (ICE in unify with nullptr)

Message ID 4EEFB5A8.6050103@redhat.com
State New
Headers show

Commit Message

Jason Merrill Dec. 19, 2011, 10:07 p.m. UTC
Just missing a case.

Tested x86_64-pc-linux-gnu, applying to trunk.

Comments

Paolo Carlini Dec. 19, 2011, 10:17 p.m. UTC | #1
On 12/19/2011 11:07 PM, Jason Merrill wrote:
> Just missing a case.
Indeed. Thanks!

Paolo.
diff mbox

Patch

commit cd8d1cb9501d6151febfba17c240f8bbba2d25af
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Dec 19 16:28:19 2011 -0500

    	PR c++/51530
    	* pt.c (unify): Handle NULLPTR_TYPE.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 66d4c3f..769b610 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -16614,6 +16614,7 @@  unify (tree tparms, tree targs, tree parm, tree arg, int strict,
     case BOOLEAN_TYPE:
     case ENUMERAL_TYPE:
     case VOID_TYPE:
+    case NULLPTR_TYPE:
       if (TREE_CODE (arg) != TREE_CODE (parm))
 	return unify_type_mismatch (explain_p, parm, arg);
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr26.C b/gcc/testsuite/g++.dg/cpp0x/nullptr26.C
new file mode 100644
index 0000000..b7421b8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr26.C
@@ -0,0 +1,13 @@ 
+// PR c++/51530
+// { dg-options -std=c++0x }
+
+template <class T, class U>
+void f(T, U);
+
+template <class T>
+void f(T, decltype(nullptr));
+
+int main()
+{
+  f(1, nullptr);
+}