https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80241
Bug ID: 80241 Summary: [5/6/7 Regression] Broken error message + ICE with invalid attribute Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: diagnostic, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following invalid code snippet triggers a broken error message followed by an ICE since GCC 5.2.0: ================================================= template <typename... T> struct A { [[gnu::aligned (alignof(A))...]] char c; }; A<int> a; ================================================= bug.cc:3:30: error: expansion pattern '#'tree_list' not supported by dump_expr#<expression error>' contains no argument packs [[gnu::aligned (alignof(A))...]] char c; ^~~ bug.cc:3:41: internal compiler error: tree check: expected tree_list, have error_mark in is_late_template_attribute, at cp/decl2.c:1119 [[gnu::aligned (alignof(A))...]] char c; ^ 0x100872c tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9817 0x6e946d tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/gcc/tree.h:3064 0x6e946d is_late_template_attribute ../../gcc/gcc/cp/decl2.c:1119 0x6e946d splice_template_attributes ../../gcc/gcc/cp/decl2.c:1179 0x6e946d save_template_attributes ../../gcc/gcc/cp/decl2.c:1205 0x6e946d cplus_decl_attributes(tree_node**, tree_node*, int) ../../gcc/gcc/cp/decl2.c:1420 0x6f036d grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ../../gcc/gcc/cp/decl2.c:951 0x71da83 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:23392 0x71e63a cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:22941 0x71e63a cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:22094 0x720bf1 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:22346 0x720bf1 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:16419 0x721ada cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:13326 0x71d275 cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:26621 0x73f19c cp_parser_template_declaration_after_parameters ../../gcc/gcc/cp/parser.c:26315 0x73ee2c cp_parser_explicit_template_declaration ../../gcc/gcc/cp/parser.c:26550 0x73ee2c cp_parser_template_declaration_after_export ../../gcc/gcc/cp/parser.c:26569 0x746fa9 cp_parser_declaration ../../gcc/gcc/cp/parser.c:12445 0x748abb cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:12372 0x748d9a cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4366 Please submit a full bug report, [etc.]