OSDN Git Service

PR c++/36435
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Jun 2011 16:52:32 +0000 (16:52 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Jun 2011 16:52:32 +0000 (16:52 +0000)
* pt.c (most_specialized_instantiation): Do check return types.

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

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

index 505de35..64a5807 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/36435
+       * pt.c (most_specialized_instantiation): Do check return types.
+
 2011-06-22  Jason Merrill  <jason@redhat.com>
 
        PR c++/49260
index 2716f78..08ce5af 100644 (file)
@@ -16610,12 +16610,12 @@ most_specialized_instantiation (tree templates)
 
       if (get_bindings (TREE_VALUE (champ),
                        DECL_TEMPLATE_RESULT (TREE_VALUE (fn)),
-                       NULL_TREE, /*check_ret=*/false))
+                       NULL_TREE, /*check_ret=*/true))
        fate--;
 
       if (get_bindings (TREE_VALUE (fn),
                        DECL_TEMPLATE_RESULT (TREE_VALUE (champ)),
-                       NULL_TREE, /*check_ret=*/false))
+                       NULL_TREE, /*check_ret=*/true))
        fate++;
 
       if (fate == -1)
@@ -16637,10 +16637,10 @@ most_specialized_instantiation (tree templates)
     for (fn = templates; fn != champ; fn = TREE_CHAIN (fn))
       if (get_bindings (TREE_VALUE (champ),
                        DECL_TEMPLATE_RESULT (TREE_VALUE (fn)),
-                       NULL_TREE, /*check_ret=*/false)
+                       NULL_TREE, /*check_ret=*/true)
          || !get_bindings (TREE_VALUE (fn),
                            DECL_TEMPLATE_RESULT (TREE_VALUE (champ)),
-                           NULL_TREE, /*check_ret=*/false))
+                           NULL_TREE, /*check_ret=*/true))
        {
          champ = NULL_TREE;
          break;
index cb31db2..8c1f886 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/36435
+       * g++.dg/template/partial9.C: New.
+
 2011-06-22  Hans-Peter Nilsson  <hp@axis.com>
 
        PR middle-end/49373
diff --git a/gcc/testsuite/g++.dg/template/partial9.C b/gcc/testsuite/g++.dg/template/partial9.C
new file mode 100644 (file)
index 0000000..4c340fc
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/36435
+
+template <class T> T f();
+template <class T> T* f() { }
+
+template int* f();