Commit d708df29 by Jason Merrill Committed by Jason Merrill

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
parent febb1302
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> 2011-06-22 Jason Merrill <jason@redhat.com>
PR c++/49260 PR c++/49260
......
...@@ -16610,12 +16610,12 @@ most_specialized_instantiation (tree templates) ...@@ -16610,12 +16610,12 @@ most_specialized_instantiation (tree templates)
if (get_bindings (TREE_VALUE (champ), if (get_bindings (TREE_VALUE (champ),
DECL_TEMPLATE_RESULT (TREE_VALUE (fn)), DECL_TEMPLATE_RESULT (TREE_VALUE (fn)),
NULL_TREE, /*check_ret=*/false)) NULL_TREE, /*check_ret=*/true))
fate--; fate--;
if (get_bindings (TREE_VALUE (fn), if (get_bindings (TREE_VALUE (fn),
DECL_TEMPLATE_RESULT (TREE_VALUE (champ)), DECL_TEMPLATE_RESULT (TREE_VALUE (champ)),
NULL_TREE, /*check_ret=*/false)) NULL_TREE, /*check_ret=*/true))
fate++; fate++;
if (fate == -1) if (fate == -1)
...@@ -16637,10 +16637,10 @@ most_specialized_instantiation (tree templates) ...@@ -16637,10 +16637,10 @@ most_specialized_instantiation (tree templates)
for (fn = templates; fn != champ; fn = TREE_CHAIN (fn)) for (fn = templates; fn != champ; fn = TREE_CHAIN (fn))
if (get_bindings (TREE_VALUE (champ), if (get_bindings (TREE_VALUE (champ),
DECL_TEMPLATE_RESULT (TREE_VALUE (fn)), DECL_TEMPLATE_RESULT (TREE_VALUE (fn)),
NULL_TREE, /*check_ret=*/false) NULL_TREE, /*check_ret=*/true)
|| !get_bindings (TREE_VALUE (fn), || !get_bindings (TREE_VALUE (fn),
DECL_TEMPLATE_RESULT (TREE_VALUE (champ)), DECL_TEMPLATE_RESULT (TREE_VALUE (champ)),
NULL_TREE, /*check_ret=*/false)) NULL_TREE, /*check_ret=*/true))
{ {
champ = NULL_TREE; champ = NULL_TREE;
break; break;
......
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> 2011-06-22 Hans-Peter Nilsson <hp@axis.com>
PR middle-end/49373 PR middle-end/49373
......
// PR c++/36435
template <class T> T f();
template <class T> T* f() { }
template int* f();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment