Just missing a case.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit cd8d1cb9501d6151febfba17c240f8bbba2d25af
Author: Jason Merrill <ja...@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);
+}

Reply via email to