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-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d708df29c844a491bcb9ec44a839b0c9b0b2010f;p=gcc.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 505de351dc5..64a5807260c 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 2716f783123..08ce5afc288 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 cb31db2e3c8..8c1f8865026 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 00000000000..4c340fc935d --- /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();