OSDN Git Service

PR c++/51530
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 22:08:29 +0000 (22:08 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 22:08:29 +0000 (22:08 +0000)
* pt.c (unify): Handle NULLPTR_TYPE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182505 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 5623bcf..3da96fe 100644 (file)
@@ -1,5 +1,8 @@
 2011-12-19  Jason Merrill  <jason@redhat.com>
 
+       PR c++/51530
+       * pt.c (unify): Handle NULLPTR_TYPE.
+
        PR c++/51526
        * semantics.c (build_data_member_initialization): Handle
        delegating constructor.
index 66d4c3f..769b610 100644 (file)
@@ -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);
 
index 9efe801..7b349c9 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51530
+       * g++.dg/cpp0x/nullptr26.C: New.
+
 2011-12-19  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.target/mips/mult-1.c: Require -O2.
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr26.C b/gcc/testsuite/g++.dg/cpp0x/nullptr26.C
new file mode 100644 (file)
index 0000000..b7421b8
--- /dev/null
@@ -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);
+}