+2018-04-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/84936 - ICE with unexpanded pack in mem-initializer.
+ * parser.c (cp_parser_mem_initializer_list): Call
+ check_for_bare_parameter_packs.
+
2018-04-04 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/85172
/* Parse the mem-initializer. */
mem_initializer = cp_parser_mem_initializer (parser);
/* If the next token is a `...', we're expanding member initializers. */
- if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
+ bool ellipsis = cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS);
+ if (ellipsis
+ || (mem_initializer != error_mark_node
+ && check_for_bare_parameter_packs (TREE_PURPOSE
+ (mem_initializer))))
{
/* Consume the `...'. */
- cp_lexer_consume_token (parser->lexer);
+ if (ellipsis)
+ cp_lexer_consume_token (parser->lexer);
/* The TREE_PURPOSE must be a _TYPE, because base-specifiers
can be expanded but members cannot. */
--- /dev/null
+// PR c++/84936
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ template<typename... T> A(T... t)
+ : decltype(t)() {} // { dg-error "parameter pack" }
+};
+
+A a;