https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112365
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:0fa32aeaa6da4ef9566d98a6fb541dd7427d7d36 commit r14-5534-g0fa32aeaa6da4ef9566d98a6fb541dd7427d7d36 Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Nov 16 17:42:22 2023 +0100 c++: Fix error recovery ICE [PR112365] check_field_decls for DECL_C_BIT_FIELD FIELD_DECLs with error_mark_node TREE_TYPE continues early and doesn't call check_bitfield_decl which would either set DECL_BIT_FIELD, or clear DECL_C_BIT_FIELD. So, the following testcase ICEs after emitting tons of errors, because SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD asserts DECL_BIT_FIELD. The patch skips that for FIELD_DECLs with error_mark_node, another option would be to check DECL_BIT_FIELD in addition to DECL_C_BIT_FIELD. 2023-11-16 Jakub Jelinek <ja...@redhat.com> PR c++/112365 * class.cc (layout_class_type): Don't SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on FIELD_DECLs with error_mark_node type. * g++.dg/cpp0x/pr112365.C: New test.