re PR c++/31441 (ICE with variadic template and specialization)

/testsuite
2007-10-11  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31441
	* g++.dg/cpp0x/variadic83.C: New.

/cp
2007-10-11  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33461
	* pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
	to convert_template_argument.
	(coerce_template_parms): Return error_mark_node after fixed-length
	error.
	(tsubst_decl): Check for error_mark_node the return value of the
	first tsubst in 'case VAR_DECL'.

/testsuite
2007-10-11  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33461
	* g++.dg/cpp0x/variadic81.C: New.
	* g++.dg/cpp0x/variadic82.C: Likewise.

From-SVN: r129229
This commit is contained in:
Paolo Carlini 2007-10-11 09:39:41 +00:00 committed by Paolo Carlini
parent 20dcff2aec
commit c343d5a731
6 changed files with 58 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2007-10-11 Paolo Carlini <pcarlini@suse.de>
PR c++/33461
* pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
to convert_template_argument.
(coerce_template_parms): Return error_mark_node after fixed-length
error.
(tsubst_decl): Check for error_mark_node the return value of the
first tsubst in 'case VAR_DECL'.
2007-10-08 Ollie Wild <aaw@google.com>
* typeck2.c (digest_init): Call cplus_expand_constant after

View File

@ -4933,9 +4933,10 @@ coerce_template_parameter_pack (tree parms,
TREE_VEC_ELT (packed_types, arg_idx - parm_idx);
}
arg = convert_template_argument (actual_parm,
arg, new_args, complain, parm_idx,
in_decl);
if (arg != error_mark_node)
arg = convert_template_argument (actual_parm,
arg, new_args, complain, parm_idx,
in_decl);
if (arg == error_mark_node)
(*lost)++;
TREE_VEC_ELT (packed_args, arg_idx - parm_idx) = arg;
@ -5086,6 +5087,7 @@ coerce_template_parms (tree parms,
else
error ("cannot expand %<%T%> into a fixed-length "
"argument list", arg);
return error_mark_node;
}
}
else if (require_all_args)
@ -8087,6 +8089,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
TYPE_NAME is not correct for the above test if
we've copied the type for a typedef. */
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
if (type == error_mark_node)
return error_mark_node;
r = TYPE_NAME (type);
break;
}

View File

@ -1,3 +1,14 @@
2007-10-11 Paolo Carlini <pcarlini@suse.de>
PR c++/31441
* g++.dg/cpp0x/variadic83.C: New.
2007-10-11 Paolo Carlini <pcarlini@suse.de>
PR c++/33461
* g++.dg/cpp0x/variadic81.C: New.
* g++.dg/cpp0x/variadic82.C: Likewise.
2007-10-11 Richard Guenther <rguenther@suse.de>
PR middle-end/33724

View File

@ -0,0 +1,11 @@
// PR c++/33461
// { dg-options "-std=gnu++0x" }
template<typename> struct A;
template<typename... T> struct A<T*> // { dg-error "not expanded|note" }
{ // { dg-error "not expanded|note" }
struct B;
};
A<void*> a;

View File

@ -0,0 +1,11 @@
// PR c++/33461
// { dg-options "-std=gnu++0x" }
template<typename> struct A;
template<typename... T> struct A<T*...> // { dg-error "cannot expand" }
{
struct B;
};
A<void*> a; // { dg-error "incomplete type" }

View File

@ -0,0 +1,8 @@
// PR c++/31441
// { dg-options "-std=gnu++0x" }
template<typename> struct A;
template<typename... T> struct A<T...> { }; // { dg-error "cannot expand" }
A<int> a; // { dg-error "incomplete type" }