aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-08-21 05:50:53 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-08-21 05:50:53 +0000
commit35c18a2035bc75f7b5dc68f5385986426b5308eb (patch)
tree26ff80d4db49e40d7a6cd3b4aecb0273a39a8fe5 /gcc/cp/pt.c
parentc4c83fff17000706cad3d2620f1e197fc4840bc3 (diff)
downloadgcc-35c18a2035bc75f7b5dc68f5385986426b5308eb.zip
gcc-35c18a2035bc75f7b5dc68f5385986426b5308eb.tar.gz
gcc-35c18a2035bc75f7b5dc68f5385986426b5308eb.tar.bz2
re PR c++/11834 (template specialization not matched)
PR c++/11834 * pt.c (more_specialized): Bump processing_template_decl. PR c++/11834 * g++.dg/template/deduce2.C: New test. From-SVN: r70639
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 20642c3..c66b5bc 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9880,6 +9880,10 @@ more_specialized (tree pat1, tree pat2, int deduce, int len)
tree targs;
int winner = 0;
+ /* If template argument deduction succeeds, we substitute the
+ resulting arguments into non-deduced contexts. While doing that,
+ we must be aware that we may encounter dependent types. */
+ ++processing_template_decl;
targs = get_bindings_real (pat1, DECL_TEMPLATE_RESULT (pat2),
NULL_TREE, 0, deduce, len);
if (targs)
@@ -9889,6 +9893,7 @@ more_specialized (tree pat1, tree pat2, int deduce, int len)
NULL_TREE, 0, deduce, len);
if (targs)
++winner;
+ --processing_template_decl;
return winner;
}