From fcea74011f2d59f310379d393799c353b7c54293 Mon Sep 17 00:00:00 2001 From: Kriang Lerdsuwanakij Date: Sun, 11 May 2003 09:45:30 +0000 Subject: [PATCH] re PR c++/10552 (Small sample using nested templates causes internal compiler error.) PR c++/10552 * pt.c (tsubst_copy): Handle TEMPLATE_DECL that is a member class template and has dependent context. * g++.dg/template/ttp6.C: New test. From-SVN: r66682 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 22 ++++++++++++++++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/ttp6.C | 21 +++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/ttp6.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 77cfaacd346..9aa822b8cef 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-05-11 Kriang Lerdsuwanakij + + 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 * pt.c (instantiate_decl): Call push/pop_deferring_access_checks. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b4a9729da0b..efc37740b0c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7294,7 +7294,29 @@ tsubst_copy (t, args, complain, in_decl) 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