https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94346
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
diag_attr_exclusions() expects either a DECL or a TYPE but here it gets an
expression:
$ gcc -S pr94346.c
pr94346.c:8:33: internal compiler error: tree check: expected class ‘type’,
have ‘expression’ (compound_expr) in diag_attr_exclusions, at attribs.c:396
8 | ATTR (copy ((bar (), ((struct A *)(0))[0]))) int m;
| ^
pr94346.c:1:35: note: in definition of macro ‘ATTR’
1 | #define ATTR(...) __attribute__ ((__VA_ARGS__))
| ^~~~~~~~~~~
0x16c3530 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/src/gcc/trunk/gcc/tree.c:9745
0x8c8271 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/src/gcc/trunk/gcc/tree.h:3401
0x8c1c5c diag_attr_exclusions
/src/gcc/trunk/gcc/attribs.c:396
0x8c1b67 diag_attr_exclusions
/src/gcc/trunk/gcc/attribs.c:379
0x8c2b75 decl_attributes(tree_node**, tree_node*, int, tree_node*)
/src/gcc/trunk/gcc/attribs.c:694
0xa45e02 handle_copy_attribute
/src/gcc/trunk/gcc/c-family/c-attribs.c:2628
0x8c2c55 decl_attributes(tree_node**, tree_node*, int, tree_node*)
/src/gcc/trunk/gcc/attribs.c:713
0x95422d c_parser_struct_declaration
/src/gcc/trunk/gcc/c/c-parser.c:3620
0x953a6b c_parser_struct_or_union_specifier
/src/gcc/trunk/gcc/c/c-parser.c:3413
0x9528fb c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
/src/gcc/trunk/gcc/c/c-parser.c:2962
0x95031f c_parser_declaration_or_fndef
/src/gcc/trunk/gcc/c/c-parser.c:1960
0x94fe3c c_parser_external_declaration
/src/gcc/trunk/gcc/c/c-parser.c:1745
0x94f95d c_parser_translation_unit
/src/gcc/trunk/gcc/c/c-parser.c:1618
0x98da25 c_parse_file()
/src/gcc/trunk/gcc/c/c-parser.c:21718
0xa19299 c_common_parse_file()
/src/gcc/trunk/gcc/c-family/c-opts.c:1186
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.