commit ba6b0740aa4f5e649ccf5d75381ae378e07567c0
Author: Jason Merrill <jason@redhat.com>
Date: Fri Aug 10 23:38:29 2018 +1200
PR c++/86728 - C variadic generic lambda.
* parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into
a pack if it's followed by a declarator-id.
@@ -21722,7 +21722,8 @@ cp_parser_parameter_declaration (cp_parser *parser,
parameter was introduced during cp_parser_parameter_declaration,
change any implicit parameters introduced into packs. */
if (parser->implicit_template_parms
- && (token->type == CPP_ELLIPSIS
+ && ((token->type == CPP_ELLIPSIS
+ && declarator_can_be_parameter_pack (declarator))
|| (declarator && declarator->parameter_pack_p)))
{
int latest_template_parm_idx = TREE_VEC_LENGTH
new file mode 100644
@@ -0,0 +1,4 @@
+// PR c++/86728
+// { dg-do compile { target c++14 } }
+
+auto c = [](auto x ...) { };