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

            Bug ID: 118304
           Summary: [15 regression] ICE on invalid constructor with an
                    asterisk
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cmingyi01 at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE in trunk.
```c++
struct A {
    *A() = default;
};
```

Output:
```
<source>:1:8: internal compiler error: in maybe_delete_defaulted_fn, at
cp/method.cc:3581
    1 | struct A {
      |        ^
0x2938005 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x294ee06 internal_error(char const*, ...)
        ???:0
0xacb06c fancy_abort(char const*, int, char const*)
        ???:0
0xc24761 defaulted_late_check(tree_node*, tristate)
        ???:0
0xb20c1b finish_struct_1(tree_node*)
        ???:0
0xb22917 finish_struct(tree_node*, tree_node*)
        ???:0
0xce562a c_parse_file()
        ???:0
0xe44f99 c_common_parse_file()
        ???:0
```
See https://compiler-explorer.com/z/aoq8bG3fx

Note: If `= default` is removed, the invalid code is accepted.

Reply via email to