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

            Bug ID: 121089
           Summary: internal compiler error: Segmentation fault
                    splay_tree_foreach since 13.1
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario.rodriguezb1 at um dot es
  Target Milestone: ---

ICE in:

Program

```
#include <ostream>
enum class Mutation : auto
{
  kSwap = 0,
};
std::ostream& operator<<(std::ostream& os, const Mutation& mutation)
{
  switch (mutation) {
    case Mutation::kSwap: return os << "kSwap";
  };
}
```

Stack dump

```
<source>:10:3: internal compiler error: Segmentation fault
   10 |   };
      |   ^
0x2879ca5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x289b986 internal_error(char const*, ...)
        ???:0
0x29a7820 splay_tree_foreach
        ???:0
0xe56b88 c_switch_covers_all_cases_p(splay_tree_s*, tree_node*)
        ???:0
0xbc0ee3 pop_switch()
        ???:0
0xd9e180 finish_switch_stmt(tree_node*)
        ???:0
0xd20193 c_parse_file()
        ???:0
0xe8a449 c_common_parse_file()
        ???:0
```

To quickly reproduce:

https://godbolt.org/z/YecfzYMnh

Reply via email to