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

            Bug ID: 115696
           Summary: [15 regression] ICE on invalid repeated mixed
                    declarations (tree check: expected class ‘type’, have
                    ‘exceptional’ (error_mark) in comptypes_verify, at
                    c/c-typeck.cc:1178)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

```
a();
a;
a()
```

```
$ gcc -c special_wrappers.c.i
special_wrappers.c.i:1:1: warning: data definition has no type or storage class
    1 | a();
      | ^
special_wrappers.c.i:1:1: error: type defaults to ‘int’ in declaration of ‘a’
[-Wimplicit-int]
special_wrappers.c.i:2:1: warning: data definition has no type or storage class
    2 | a;
      | ^
special_wrappers.c.i:2:1: error: type defaults to ‘int’ in declaration of ‘a’
[-Wimplicit-int]
special_wrappers.c.i:2:1: error: ‘a’ redeclared as different kind of symbol
special_wrappers.c.i:1:1: note: previous declaration of ‘a’ with type ‘int()’
    1 | a();
      | ^
special_wrappers.c.i:3:1: error: return type defaults to ‘int’ [-Wimplicit-int]
    3 | a()
      | ^
special_wrappers.c.i:3:1: internal compiler error: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in comptypes_verify, at
c/c-typeck.cc:1178
0x557e5ec7bf8a internal_error(char const*, ...)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/diagnostic-global-context.cc:491
0x557e5e596d0e tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree.cc:9051
0x557e5d689258 tree_class_check(tree_node*, tree_code_class, char const*, int,
char const*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree.h:3787
0x557e5d689258 comptypes_verify
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-typeck.cc:1178
0x557e5d689258 comptypes_verify
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-typeck.cc:1176
0x557e5ee8be02 comptypes(tree_node*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-typeck.cc:1212
0x557e5edeb97e pushdecl(tree_node*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-decl.cc:3381
0x557e5f5dcacc start_function(c_declspecs*, c_declarator*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-decl.cc:10800
0x557e5f5d83e2 c_parser_declaration_or_fndef
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:2919
0x557e5f5d77fb c_parser_external_declaration
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:2053
0x557e5f5d3daa c_parser_translation_unit
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:1907
0x557e5f5d3daa c_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:27298
0x557e5f5c8f10 c_common_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c-family/c-opts.cc:1322
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

Reply via email to