* pt.c (more_specialized): Bump processing_template_decl.
PR c++/11834
* g++.dg/template/deduce2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70639
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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)
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.
--- /dev/null
+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);
+}