From: Giovanni Bajo Date: Thu, 26 Feb 2004 20:46:08 +0000 (+0000) Subject: re PR c++/14284 (Failure to select obvious template specialisation) X-Git-Tag: releases/gcc-4.0.0~9822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bf92cb6097c0efb59cab150cf308322256fb28c;p=thirdparty%2Fgcc.git re PR c++/14284 (Failure to select obvious template specialisation) PR c++/14284 * pt.c (dependent_type_p_r): A template template parameter is a dependent type. PR c++/14284 * g++.dg/template/ttp8.C: New test. From-SVN: r78522 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 85ee089dbd56..affca567d3aa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-02-26 Giovanni Bajo + + PR c++/14284 + * pt.c (dependent_type_p_r): A template template parameter is a + dependent type. + 2004-02-26 Giovanni Bajo PR c++/14246 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1f97a536b23a..7a08edaf7791 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11544,8 +11544,11 @@ dependent_type_p_r (tree type) A type is dependent if it is: - -- a template parameter. */ - if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) + -- a template parameter. Template template parameters are + types for us (since TYPE_P holds true for them) so we + handle them here. */ + if (TREE_CODE (type) == TEMPLATE_TYPE_PARM + || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM) return true; /* -- a qualified-id with a nested-name-specifier which contains a class-name that names a dependent type or whose unqualified-id diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 508a19247d5b..f66cd592f96d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-26 Giovanni Bajo + + PR c++/14284 + * g++.dg/template/ttp8.C: New test. + 2004-02-26 Eric Botcazou * gcc.dg/fixuns-trunc-1.c: New test. diff --git a/gcc/testsuite/g++.dg/template/ttp8.C b/gcc/testsuite/g++.dg/template/ttp8.C new file mode 100644 index 000000000000..99f99b965a1c --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp8.C @@ -0,0 +1,16 @@ +// { dg-do compile } +// Contributed by: Niall Douglas +// PR c++/14284: Failure to select specialization + +template struct S; +template class> struct I {}; + +template struct Match; + +template class C> +struct Match, 0> {}; + +template class C, int i> +struct Match, i>; + +Match, 0> v;