https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107574
Bug ID: 107574 Summary: [10/11/12/13 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have integer_type in cp_fold_convert, at cp/cvt.cc:613 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Affects versions down to r9 : $ cat z1.cc struct A { int i; }; struct B:A { int j; }; struct C:B { int k; static_assert((int(B::*))&C::k, ""); }; $ g++-13-20221106 -c z1.cc z1.cc:3:50: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have integer_type in cp_fold_convert, at cp/cvt.cc:613 3 | struct C:B { int k; static_assert((int(B::*))&C::k, ""); }; | ^ 0x70312c tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/tree.cc:8846 0x8af521 tree_check3(tree_node*, char const*, int, char const*, tree_code, tree_code, tree_code) ../../gcc/tree.h:3572 0x8af521 cp_fold_convert(tree_node*, tree_node*) ../../gcc/cp/cvt.cc:612 0x8666a4 cxx_eval_constant_expression ../../gcc/cp/constexpr.cc:7602 0x8708fa cxx_eval_outermost_constant_expr ../../gcc/cp/constexpr.cc:8142 0x8757ea maybe_constant_value(tree_node*, tree_node*, bool) ../../gcc/cp/constexpr.cc:8412 0x8aa095 cp_fully_fold(tree_node*) ../../gcc/cp/cp-gimplify.cc:2370 0xb46c51 cp_build_binary_op(op_location_t const&, tree_code, tree_node*, tree_node*, int) ../../gcc/cp/typeck.cc:6565 0xb4bb63 convert_ptrmem(tree_node*, tree_node*, bool, bool, int) ../../gcc/cp/typeck.cc:8171 0xb522f2 cp_build_c_cast(unsigned int, tree_node*, tree_node*, int) ../../gcc/cp/typeck.cc:9189 0xb528b1 build_c_cast(unsigned int, tree_node*, cp_expr) ../../gcc/cp/typeck.cc:9095 0x9f0682 cp_parser_cast_expression ../../gcc/cp/parser.cc:9978 0x9f0ccf cp_parser_binary_expression ../../gcc/cp/parser.cc:10091 0x9f1a74 cp_parser_assignment_expression ../../gcc/cp/parser.cc:10431 0x9f48a5 cp_parser_constant_expression ../../gcc/cp/parser.cc:10726 0x9f504e cp_parser_static_assert ../../gcc/cp/parser.cc:16280 0xa39204 cp_parser_member_declaration ../../gcc/cp/parser.cc:27068 0xa013b2 cp_parser_member_specification_opt ../../gcc/cp/parser.cc:26936 0xa013b2 cp_parser_class_specifier ../../gcc/cp/parser.cc:26011 0xa04240 cp_parser_type_specifier ../../gcc/cp/parser.cc:19387