Commit 56992a78 by Jason Merrill Committed by Jason Merrill

re PR c++/47220 ([C++0x] no error on unterminated template argument list for variadic parameter)

	PR c++/47220
	* pt.c (coerce_template_parameter_pack): Check for error_mark_node.

From-SVN: r186480
parent f9057514
2012-04-15 Jason Merrill <jason@redhat.com>
PR c++/47220
* pt.c (coerce_template_parameter_pack): Check for error_mark_node.
PR c++/52292
PR c++/52380
* pt.c (coerce_template_parms): Even if we aren't converting we
......
......@@ -6697,7 +6697,12 @@ coerce_template_parameter_pack (tree parms,
TREE_VEC_ELT (packed_types, arg_idx - parm_idx);
}
if (arg != error_mark_node)
if (arg == error_mark_node)
{
if (complain & tf_error)
error ("template argument %d is invalid", arg_idx + 1);
}
else
arg = convert_template_argument (actual_parm,
arg, new_args, complain, parm_idx,
in_decl);
......
2012-04-15 Jason Merrill <jason@redhat.com>
PR c++/47220
* g++.dg/cpp0x/variadic126.C: New.
PR c++/52380
* g++.dg/cpp0x/variadic125.C: New.
......
......@@ -2,6 +2,7 @@
// Origin: PR c++/39639
// { dg-do compile }
// { dg-options "-std=c++0x" }
// { dg-prune-output "template argument 1 is invalid" }
template <class... Types>
struct S
......
// PR c++/47220
// { dg-do compile { target c++11 } }
template < typename ... > struct A;
struct B : A < // { dg-error "invalid" }
{
};
......@@ -22,7 +22,7 @@ namespace A
{
template <typename T>
struct I : H <T> {};
template <typename ...> struct J;
template <typename ...> struct J {};
template <typename> struct K;
struct L
{
......@@ -36,7 +36,7 @@ namespace A
template <typename T, typename B2, typename ... B4>
struct N <T (B4 ...), B2> : L::M <B2> {};
template <typename T, typename ... B4>
struct K <T (B4 ...)> :J <,>, L
struct K <T (B4 ...)> :J <>, L
{
typedef T O (B4 ...);
struct P {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment