diff options
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/partial9.C | 6 |
4 files changed, 20 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 505de35..64a5807 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2716f78..08ce5af 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cb31db2..8c1f886 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..4c340fc --- /dev/null +++ b/gcc/testsuite/g++.dg/template/partial9.C @@ -0,0 +1,6 @@ +// PR c++/36435 + +template <class T> T f(); +template <class T> T* f() { } + +template int* f(); |