Commit 35c18a20 by Mark Mitchell Committed by Mark Mitchell

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
parent c4c83fff
2003-08-20 Mark Mitchell <mark@codesourcery.com>
PR c++/11834
* pt.c (more_specialized): Bump processing_template_decl.
2003-08-21 Jason Merrill <jason@redhat.com>
PR c++/11614
......
......@@ -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;
}
......
2003-08-20 Mark Mitchell <mark@codesourcery.com>
PR c++/11834
* g++.dg/template/deduce2.C: New test.
2003-08-21 Josef Zlomek <zlomekj@suse.cz>
* gcc.c-torture/execute/20030821-1.c: New test.
......
template <typename T0> struct tuple {
typedef tuple<int> tail;
};
template <> struct tuple<int> {
};
template <typename L>
struct length {
static const int i = length<typename tuple<L>::tail>::i;
};
template<>
struct length<tuple<int> > {
static const int i = 1;
};
template <int> struct M {};
template <typename A>
M<length<tuple<A> >::i > foo (A*);
template <typename A>
M<length<tuple<A> >::i> foo (const A*);
const int i1 = 3;
void bar() {
foo (&i1);
}
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