https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81252
Bug ID: 81252
Summary: ICE on valid C++ code: in pop_local_binding, at
cp/name-lookup.c:1404
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: ---
It affects at least all versions 4.8.x and later.
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20170629 (experimental) [trunk revision 249769] (GCC)
$
$ clang++-4.0.0 -c small.cpp
$ icc -c small.cpp
$
$ g++-trunk -c small.cpp
small.cpp: In function ‘void f()’:
small.cpp:9:4: internal compiler error: in pop_local_binding, at
cp/name-lookup.c:1404
};
^
0x7cdb6a pop_local_binding(tree_node*, tree_node*)
../../gcc-source-trunk/gcc/cp/name-lookup.c:1404
0x75afbb poplevel(int, int, int)
../../gcc-source-trunk/gcc/cp/decl.c:773
0x8a6b83 do_poplevel(tree_node*)
../../gcc-source-trunk/gcc/cp/semantics.c:448
0x8a99e9 finish_compound_stmt(tree_node*)
../../gcc-source-trunk/gcc/cp/semantics.c:1442
0x800727 cp_parser_compound_statement
../../gcc-source-trunk/gcc/cp/parser.c:11132
0x818868 cp_parser_function_body
../../gcc-source-trunk/gcc/cp/parser.c:21592
0x818868 cp_parser_ctor_initializer_opt_and_function_body
../../gcc-source-trunk/gcc/cp/parser.c:21628
0x819331 cp_parser_function_definition_after_declarator
../../gcc-source-trunk/gcc/cp/parser.c:26460
0x81a12d cp_parser_function_definition_from_specifiers_and_declarator
../../gcc-source-trunk/gcc/cp/parser.c:26372
0x81a12d cp_parser_init_declarator
../../gcc-source-trunk/gcc/cp/parser.c:19312
0x81c6df cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12945
0x81d50a cp_parser_block_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12763
0x825704 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12660
0x824126 cp_parser_declaration_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:12536
0x824444 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4386
0x824444 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:38642
0x968075 c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1104
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 S {};
void f ()
{
struct A
{
struct S s;
void g (struct s);
};
}