commit 601d1dd536710d65054d6a24bbae2bbf7f1e466b
Author: Jason Merrill <jason@redhat.com>
Date: Sun Apr 15 20:58:07 2012 -0400
PR c++/47220
* pt.c (coerce_template_parameter_pack): Check for error_mark_node.
@@ -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);
@@ -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
new file mode 100644
@@ -0,0 +1,8 @@
+// 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 {};