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

            Bug ID: 84663
           Summary: internal compiler error: tree check: expected
                    array_type, have error_mark in cp_complete_array_type,
                    at cp/decl.c:8334
           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:

struct c {
  typedef c a[alignof(long)];
  int f:-1ULL;
  c() {
    struct {
      a d;
    } e[];
  }
};

Output:

$ xgcc -x c++ -S -
<stdin>:3:10: warning: width of 'c::f' exceeds its type
<stdin>: In constructor 'c::c()':
<stdin>:7:9: error: size of array is too large
<stdin>:7:9: internal compiler error: tree check: expected array_type, have
error_mark in cp_complete_array_type, at cp/decl.c:8334
0x65f900 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /home/vegard/git/gcc/gcc/tree.c:9337
0xb45e66 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/vegard/git/gcc/gcc/tree.h:3132
0xb45e66 cp_complete_array_type(tree_node**, tree_node*, bool)
        /home/vegard/git/gcc/gcc/cp/decl.c:8334
0xb463f0 maybe_deduce_size_from_array_init
        /home/vegard/git/gcc/gcc/cp/decl.c:5445
0xb47f66 check_initializer
        /home/vegard/git/gcc/gcc/cp/decl.c:6369
0xbdcd8e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /home/vegard/git/gcc/gcc/cp/decl.c:7084
0xfa49d9 cp_parser_init_declarator
        /home/vegard/git/gcc/gcc/cp/parser.c:19722
0xfa9757 cp_parser_simple_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:13063
0xfaf948 cp_parser_block_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12881
0xfb1e14 cp_parser_declaration_statement
        /home/vegard/git/gcc/gcc/cp/parser.c:12474
0xefdd8b cp_parser_statement
        /home/vegard/git/gcc/gcc/cp/parser.c:10923
0xf0184b cp_parser_statement_seq_opt
        /home/vegard/git/gcc/gcc/cp/parser.c:11272
0xf022ea cp_parser_compound_statement
        /home/vegard/git/gcc/gcc/cp/parser.c:11226
0xf967eb cp_parser_function_body
        /home/vegard/git/gcc/gcc/cp/parser.c:21769
0xf967eb cp_parser_ctor_initializer_opt_and_function_body
        /home/vegard/git/gcc/gcc/cp/parser.c:21804
0xf9f9f5 cp_parser_function_definition_after_declarator
        /home/vegard/git/gcc/gcc/cp/parser.c:26809
0xfa1cbc cp_parser_late_parsing_for_member
        /home/vegard/git/gcc/gcc/cp/parser.c:27690
0xf1aed5 cp_parser_class_specifier_1
        /home/vegard/git/gcc/gcc/cp/parser.c:22733
0xf2642b cp_parser_class_specifier
        /home/vegard/git/gcc/gcc/cp/parser.c:22759
0xf2642b cp_parser_type_specifier
        /home/vegard/git/gcc/gcc/cp/parser.c:16765

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

Built from git c435a9e730c6e8f10da09d58b4fc9aaeb401b0d5 (r258097).

Doesn't seem present on 7.3.0.

Test case was minimised by C-Reduce.

Reply via email to