re PR c++/27425 (ICE with invalid template-template-parameter)

PR c++/27425
	PR c++/34274
	PR c++/42301
	* pt.c (expand_template_argument_pack): Handle null arg gracefully.
	(convert_template_argument): Use %T for type.

From-SVN: r155149
This commit is contained in:
Jason Merrill 2009-12-11 00:26:51 -05:00 committed by Jason Merrill
parent b1faa8d9ca
commit 302e39e5a8
4 changed files with 28 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2009-11-13 Jason Merrill <jason@redhat.com>
PR c++/27425
PR c++/34274
PR c++/42301
* pt.c (expand_template_argument_pack): Handle null arg gracefully.
(convert_template_argument): Use %T for type.
2009-11-17 Jakub Jelinek <jakub@redhat.com>
PR c++/42061

View File

@ -2780,6 +2780,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));
@ -5088,7 +5090,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,3 +1,9 @@
2009-11-13 Jason Merrill <jason@redhat.com>
PR c++/27425
PR c++/34274
* g++.dg/template/arg7.C: New.
2009-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/42268

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