https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88193
Bug ID: 88193
Summary: ICE on (invalid) C++ code: Segmentation fault
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
This appears to be a recent regression.
$ g++tk -v
Using built-in specs.
COLLECT_GCC=g++tk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 9.0.0 20181125 (experimental) [trunk revision 266435] (GCC)
$
$ g++tk tmp.cpp
tmp.cpp:3:16: internal compiler error: Segmentation fault
3 | friend int : 8;
| ^
0xfd21af crash_signal
../../gcc-source-trunk/gcc/toplev.c:326
0x85b5a5 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
../../gcc-source-trunk/gcc/cp/decl.c:12429
0x8661ac grokbitfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
tree_node*, tree_node*)
../../gcc-source-trunk/gcc/cp/decl2.c:1015
0x91f6bc cp_parser_member_declaration
../../gcc-source-trunk/gcc/cp/parser.c:24232
0x90338f cp_parser_member_specification_opt
../../gcc-source-trunk/gcc/cp/parser.c:23860
0x90338f cp_parser_class_specifier_1
../../gcc-source-trunk/gcc/cp/parser.c:23004
0x905759 cp_parser_class_specifier
../../gcc-source-trunk/gcc/cp/parser.c:23266
0x905759 cp_parser_type_specifier
../../gcc-source-trunk/gcc/cp/parser.c:17231
0x90f353 cp_parser_decl_specifier_seq
../../gcc-source-trunk/gcc/cp/parser.c:13965
0x91a801 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:13271
0x923b90 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:13087
0x922b05 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4674
0x922b05 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:40680
0xa7e34a c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1151
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.
$
-----------------------
struct A
{
friend int : 8;
};