From: Kriang Lerdsuwanakij Date: Tue, 27 Jul 2004 15:47:10 +0000 (+0000) Subject: re PR c++/14429 (valid template template argument rejected) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00bdb87f8e8107ade3abd37e37db8270a0016bc3;p=gcc.git re PR c++/14429 (valid template template argument rejected) PR c++/14429 * pt.c (coerce_template_template_parms) : Only check when the type of ARG is not dependent. * g++.dg/template/ttp11.C: New test. From-SVN: r85222 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 329b12e5c7b..3a270bc3fd9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-27 Kriang Lerdsuwanakij + + PR c++/14429 + * pt.c (coerce_template_template_parms) : Only check + when the type of ARG is not dependent. + 2004-07-26 Geoffrey Keating * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ca84b394423..7ae18f8f120 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3639,11 +3639,16 @@ coerce_template_template_parms (tree parm_parms, case PARM_DECL: /* The tsubst call is used to handle cases such as - template class TT> class D; + + template class C {}; + template class TT> class D {}; + D d; + i.e. the parameter list of TT depends on earlier parameters. */ - if (!same_type_p - (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl), - TREE_TYPE (arg))) + if (!dependent_type_p (TREE_TYPE (arg)) + && !same_type_p + (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl), + TREE_TYPE (arg))) return 0; break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf237103596..bc4bea22867 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-27 Kriang Lerdsuwanakij + + PR c++/14429 + * g++.dg/template/ttp11.C: New test. + 2004-07-27 Diego Novillo * gcc.c-torture/compile/20040727-1.c: New test. diff --git a/gcc/testsuite/g++.dg/template/ttp11.C b/gcc/testsuite/g++.dg/template/ttp11.C new file mode 100644 index 00000000000..84867e1073e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp11.C @@ -0,0 +1,14 @@ +// { dg-do compile } + +// Origin: heinlein@informatik.uni-ulm.de + +// PR c++/14429: Matching of template template parameter containing +// non-type parameter with type that depends on earlier parameter. + +template