2016-11-12 Jason Merrill <jason@redhat.com>
+ CWG 2233
+ * typeck.c (convert_arguments): Handle default arg followed by none.
+
* constexpr.c (potential_constant_expression_1): REALPART_EXPR and
IMAGPART_EXPR can be lvalues.
{
for (; typetail != void_list_node; ++i)
{
+ /* After DR777, with explicit template args we can end up with a
+ default argument followed by no default argument. */
+ if (!TREE_PURPOSE (typetail))
+ break;
tree parmval
= convert_default_arg (TREE_VALUE (typetail),
TREE_PURPOSE (typetail),
break;
}
}
- else
+
+ if (typetail && typetail != void_list_node)
{
- if (complain & tf_error)
+ if (complain & tf_error)
error_args_num (input_location, fndecl, /*too_many_p=*/false);
return -1;
}
--- /dev/null
+// DR 2233
+// { dg-do compile { target c++11 } }
+
+template<typename ...T> void f(int n = 0, T ...t);
+
+int main()
+{
+ f<int>(); // { dg-error "too few arguments" }
+}