diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-13 13:46:47 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-13 13:46:47 -0500 |
commit | 5b6dad5d8fbc79a1029f55e565336df4b74ed3c6 (patch) | |
tree | 958e6c0f89c03cb213cac1100fedef710dab9406 | |
parent | 9dd90d8e354751116b280bfb6884d3bdd7c6dc59 (diff) | |
download | gcc-5b6dad5d8fbc79a1029f55e565336df4b74ed3c6.zip gcc-5b6dad5d8fbc79a1029f55e565336df4b74ed3c6.tar.gz gcc-5b6dad5d8fbc79a1029f55e565336df4b74ed3c6.tar.bz2 |
re PR c++/27425 (ICE with invalid template-template-parameter)
PR c++/27425
PR c++/34274
* pt.c (expand_template_argument_pack): Handle null arg gracefully.
(convert_template_argument): Use %T for type.
From-SVN: r154164
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/arg7.C | 11 |
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 722c983..d5dc053 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2009-11-13 Jason Merrill <jason@redhat.com> + PR c++/27425 + PR c++/34274 + * pt.c (expand_template_argument_pack): Handle null arg gracefully. + (convert_template_argument): Use %T for type. + PR c++/29363 * decl.c (create_implicit_typedef): Set TYPE_STUB_DECL here. (cxx_init_decl_processing): Not here. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 540f577..b7d72c1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3150,6 +3150,8 @@ expand_template_argument_pack (tree args) for (in_arg = 0; in_arg < nargs; ++in_arg) { tree arg = TREE_VEC_ELT (args, in_arg); + if (arg == NULL_TREE) + return args; if (ARGUMENT_PACK_P (arg)) { int num_packed = TREE_VEC_LENGTH (ARGUMENT_PACK_ARGS (arg)); @@ -5472,7 +5474,7 @@ convert_template_argument (tree parm, error ("type/value mismatch at argument %d in " "template parameter list for %qD", i + 1, in_decl); - error (" expected a template of type %qD, got %qD", + error (" expected a template of type %qD, got %qT", parm, orig_arg); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9149067..e26d705 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2009-11-13 Jason Merrill <jason@redhat.com> + PR c++/27425 + PR c++/34274 + * g++.dg/template/arg7.C: New. + PR c++/29363 * g++.dg/template/error43.C: New. diff --git a/gcc/testsuite/g++.dg/template/arg7.C b/gcc/testsuite/g++.dg/template/arg7.C new file mode 100644 index 0000000..a9333b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/arg7.C @@ -0,0 +1,11 @@ +// PR c++/27425, 34274 + +template<typename T> struct A +{ + template<template<T> class> struct B {}; // { dg-error "void|mismatch|expected" } + // { dg-bogus "not supported" "" { target *-*-* } 5 } + template<T> struct C; // { dg-error "void" } + B<C> b; +}; + +A<void> a; // { dg-message "instantiated" } |