http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58700
Bug ID: 58700 Summary: [4.8/4.9 Regression] ICE declaring static bit-field Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet triggers an ICE since GCC 4.8.0: ===================== struct A { static int : 4; }; ===================== bug.cc:3:16: internal compiler error: Segmentation fault static int : 4; ^ 0xb15dff crash_signal ../../gcc/gcc/toplev.c:335 0x5831a7 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../gcc/gcc/cp/decl.c:10642 0x617fcd grokbitfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, tree_node*) ../../gcc/gcc/cp/decl2.c:1043 0x660ba6 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20031 0x6402c7 cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:19726 0x6402c7 cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:18970 0x6402c7 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19197 0x6402c7 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14144 0x65924f cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11389 0x65fd89 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10979 0x643860 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10928 0x66aaae cp_parser_declaration ../../gcc/gcc/cp/parser.c:10825 0x6697ca cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10711 0x66b0e6 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3989 0x66b0e6 c_parse_file() ../../gcc/gcc/cp/parser.c:30962 0x787f73 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.] GCC 4.7.x issued a suitable error message instead: bug.cc:3:16: error: static member '<anonymous>' cannot be a bit-field