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
This commit is contained in:
Jason Merrill 2009-11-13 13:46:47 -05:00 committed by Jason Merrill
parent 9dd90d8e35
commit 5b6dad5d8f
4 changed files with 23 additions and 1 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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.

View File

@ -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" }