+2003-05-11 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10552
+ * pt.c (tsubst_copy): Handle TEMPLATE_DECL that is a member class
+ template and has dependent context.
+
2003-05-10 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* pt.c (instantiate_decl): Call push/pop_deferring_access_checks.
args, complain, in_decl);
else if (is_member_template (t))
return tsubst (t, args, complain, in_decl);
+ else if (DECL_CLASS_SCOPE_P (t)
+ && uses_template_parms (DECL_CONTEXT (t)))
+ {
+ /* Template template argument like the following example need
+ special treatment:
+
+ template <template <class> class TT> struct C {};
+ template <class T> struct D {
+ template <class U> struct E {};
+ C<E> c; // #1
+ };
+ D<int> d; // #2
+
+ We are processing the template argument `E' in #1 for
+ the template instantiation #2. Originally, `E' is a
+ TEMPLATE_DECL with `D<T>' as its DECL_CONTEXT. Now we
+ have to substitute this with one having context `D<int>'. */
+
+ tree context = tsubst (DECL_CONTEXT (t), args, complain, in_decl);
+ return lookup_field (context, DECL_NAME(t), 0, false);
+ }
else
+ /* Ordinary template template argument. */
return t;
case LOOKUP_EXPR:
+2003-05-11 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10552
+ * g++.dg/template/ttp6.C: New test.
+
2003-05-11 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/execute/builtins: New directory.
--- /dev/null
+// { dg-do compile }
+
+// Origin: Eelis van der Weegen <gccbugs@contacts.eelis.net>
+
+// PR c++/10552: Member class template as template template argument
+// substitution issue.
+
+template <template <typename> class A, typename>
+struct B
+{
+ typedef typename A<int>::t t;
+};
+
+template <typename D>
+struct E
+{
+ template <typename> struct F { typedef int t; };
+ typedef typename B<F, D>::t t;
+};
+
+typedef E<int>::t t;