From: Jason Merrill Date: Thu, 23 Jun 2011 16:52:32 +0000 (-0400) Subject: re PR c++/36435 (Partial ordering of explicit specialization should include return... X-Git-Tag: upstream/12.2.0~83400 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d708df29c844a491bcb9ec44a839b0c9b0b2010f;p=platform%2Fupstream%2Fgcc.git re PR c++/36435 (Partial ordering of explicit specialization should include return type) PR c++/36435 * pt.c (most_specialized_instantiation): Do check return types. From-SVN: r175338 --- 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 + + PR c++/36435 + * pt.c (most_specialized_instantiation): Do check return types. + 2011-06-22 Jason Merrill 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 + + PR c++/36435 + * g++.dg/template/partial9.C: New. + 2011-06-22 Hans-Peter Nilsson 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 T f(); +template T* f() { } + +template int* f();