diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-26 20:46:08 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-26 20:46:08 +0000 |
commit | 6bf92cb6097c0efb59cab150cf308322256fb28c (patch) | |
tree | 4387885e1548bea06acff84b1d2f402607a8a27c | |
parent | 48c0150c2318a3c1b0f00d45017733fa89d7a9d0 (diff) | |
download | gcc-6bf92cb6097c0efb59cab150cf308322256fb28c.zip gcc-6bf92cb6097c0efb59cab150cf308322256fb28c.tar.gz gcc-6bf92cb6097c0efb59cab150cf308322256fb28c.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ttp8.C | 16 |
4 files changed, 32 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 85ee089..affca567 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org> + PR c++/14284 + * pt.c (dependent_type_p_r): A template template parameter is a + dependent type. + +2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org> + PR c++/14246 * mangle.c (write_template_arg_literal): Don't rely on identity for boolean constants. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1f97a53..7a08edaf 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 508a192..f66cd59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org> + + PR c++/14284 + * g++.dg/template/ttp8.C: New test. + 2004-02-26 Eric Botcazou <ebotcazou@act-europe.fr> * 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 0000000..99f99b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp8.C @@ -0,0 +1,16 @@ +// { dg-do compile } +// Contributed by: Niall Douglas <s_gccbugzilla at netprod dot com> +// PR c++/14284: Failure to select specialization + +template<typename> struct S; +template<template<class> class> struct I {}; + +template<class, int> struct Match; + +template<template<class> class C> +struct Match<I<C>, 0> {}; + +template<template<class> class C, int i> +struct Match<I<C>, i>; + +Match<I<S>, 0> v; |