https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

            Bug ID: 84707
           Summary: internal compiler error: Segmentation fault
                    (tree_check()/duplicate_decls())
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at gmail dot com
                CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input (this one is positively cute):

inline namespace {
        namespace {}
}

namespace {}

Output:

$ xgcc -x c++ -S  -
<stdin>:5:1: internal compiler error: Segmentation fault
0x3156909 crash_signal
        /home/vegard/git/gcc/gcc/toplev.c:325
0xb8cefc tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/vegard/git/gcc/gcc/tree.h:3131
0xb8cefc duplicate_decls(tree_node*, tree_node*, bool)
        /home/vegard/git/gcc/gcc/cp/decl.c:1413
0xe5f3e9 do_pushdecl
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:3019
0xe6b16a pushdecl(tree_node*, bool)
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:3154
0xe6b16a push_namespace(tree_node*, bool)
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:6953
0xffd25f cp_parser_namespace_definition
        /home/vegard/git/gcc/gcc/cp/parser.c:18579
0x100203f cp_parser_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12762
0xff9d9b cp_parser_declaration_seq_opt
        /home/vegard/git/gcc/gcc/cp/parser.c:12654
0xffb3c3 cp_parser_translation_unit
        /home/vegard/git/gcc/gcc/cp/parser.c:4561
0xffb3c3 c_parse_file()
        /home/vegard/git/gcc/gcc/cp/parser.c:38993
0x15a7105 c_common_parse_file()
        /home/vegard/git/gcc/gcc/c-family/c-opts.c:1132

$ xgcc --version
xgcc (GCC) 8.0.1 20180303 (experimental)

Built from git 0d86c284d085d29782d862600a79aa1ff0ee0c47 (r258221).

Looks fine with 7.3.0.

Test case was minimised by C-Reduce.

Reply via email to