* error.c (dump_expr): Handle TREE_LIST.
* parser.c (cp_parser_std_attribute_list): Return error_mark if
make_pack_expansion returns an error.
* g++.dg/cpp0x/alignas11.C: New test.
From-SVN: r249621
+2017-06-24 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-04-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/80241 - ICE with alignas pack expansion.
+ * error.c (dump_expr): Handle TREE_LIST.
+ * parser.c (cp_parser_std_attribute_list): Return error_mark if
+ make_pack_expansion returns an error.
+
2017-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
pp_string (pp, M_("*this"));
break;
+ case TREE_LIST:
+ dump_expr_list (pp, t, flags);
+ break;
+
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
`report_error_function'. That could cause an infinite loop. */
error_at (token->location,
"expected attribute before %<...%>");
else
- TREE_VALUE (attribute)
- = make_pack_expansion (TREE_VALUE (attribute));
+ {
+ tree pack = make_pack_expansion (TREE_VALUE (attribute));
+ if (pack == error_mark_node)
+ return error_mark_node;
+ TREE_VALUE (attribute) = pack;
+ }
token = cp_lexer_peek_token (parser->lexer);
}
if (token->type != CPP_COMMA)
+2017-06-24 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-04-18 Marek Polacek <polacek@redhat.com>
+
+ PR c++/80241 - ICE with alignas pack expansion.
+ * g++.dg/cpp0x/alignas11.C: New test.
+
2017-06-23 Thomas Preud'homme <thomas.preudhomme@arm.com>
Backport from mainline
--- /dev/null
+// PR c++/80241
+// { dg-do compile { target c++11 } }
+
+template <typename... T>
+struct A
+{
+ [[gnu::aligned (alignof(A))...]] char c; // { dg-error "expansion pattern" }
+};
+
+A<int> a;