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

            Bug ID: 126031
           Summary: ICE on anonymous struct declaration inside typedef
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s.kimura.h41104 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/onvxTxh67

Reproducer:
```
typedef struct {
  struct S;
} s;
```

Backtrace:
<source>:3:3: internal compiler error: Segmentation fault
    3 | } s;
      |   ^
0x2a1ec38 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2a1387b internal_error(char const*, ...)
        ???:0
0xc158a0 name_unnamed_type(tree_node*, tree_node*)
        ???:0
0xc366d7 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0xc38508 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ???:0
0xd89013 c_parse_file()
        ???:0
0xf197e9 c_common_parse_file()
        ???:0

This ICE goes back to gcc-16:
https://godbolt.org/z/5Ev1dM8q1

Reply via email to