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

            Bug ID: 93752
           Summary: internal compiler error: in pop_local_binding, at
                    cp/name-lookup.c:2036
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int main ( void ) {
    struct s1 {
        int s ;
        struct s2 {
            int tbl[ sizeof ( struct s ) ] ;
        } ;
    };
    return 0 ;
}
---

Run script:
---
g++ -o poc poc.cpp
---

Stack dump:
---
 int main()
./poc.c:5:22: error: invalid application of ‘sizeof’ to incomplete type
‘main()::s’
    5 |             int tbl[ sizeof ( struct s ) ] ;
      |                      ^~~~~~~~~~~~~~~~~~~
./poc.c:8:14: internal compiler error: in pop_local_binding, at
cp/name-lookup.c:2036
    8 |     return 0 ;
      |              ^
0x69dfd6 pop_local_binding(tree_node*, tree_node*)
        ../../gcc/cp/name-lookup.c:2036
0x96d266 poplevel(int, int, int)
        ../../gcc/cp/decl.c:702
0xa8710b do_poplevel(tree_node*)
        ../../gcc/cp/semantics.c:452
0xa8ac49 finish_compound_stmt(tree_node*)
        ../../gcc/cp/semantics.c:1541
0x9fc574 cp_parser_compound_statement
        ../../gcc/cp/parser.c:11745
0xa132d5 cp_parser_function_body
        ../../gcc/cp/parser.c:22981
0xa132d5 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.c:23032
0xa1662d cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.c:28880
0xa17636 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.c:28796
0xa17636 cp_parser_init_declarator
        ../../gcc/cp/parser.c:20596
0x9f8be0 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13678
0xa217d2 cp_parser_declaration
        ../../gcc/cp/parser.c:13377
0xa21f52 cp_parser_translation_unit
        ../../gcc/cp/parser.c:4731
0xa21f52 c_parse_file()
        ../../gcc/cp/parser.c:43709
0xb361eb c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1186
Please submit a full bug report,
---

Reply via email to