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

            Bug ID: 122562
           Summary: internal compiler error: Segmentation fault
                    cp_type_quals with std=c++20 since 10.2
           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: ---

## Program

```
#include <iostream>
enum class Errors : int {
    Err_V1,
    Err_V2,
};
auto operator<=>(Errors lhs, Errors rhs) noexcept = default;

```

## Stack dump

```
<source>:6:53: internal compiler error: Segmentation fault
    6 | auto operator<=>(Errors lhs, Errors rhs) noexcept = default;
      |                                                     ^~~~~~~
0x2903958 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x28f874b internal_error(char const*, ...)
        ???:0
0xe11b38 cp_type_quals(tree_node const*)
        ???:0
0xe04daf cp_build_qualified_type(tree_node*, int, int)
        ???:0
0xe14651 same_type_ignoring_top_level_qualifiers_p(tree_node*, tree_node*)
        ???:0
0xc7a9b2 defaultable_fn_check(tree_node*)
        ???:0
0xc118d6 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ???:0
0xd45d23 c_parse_file()
        ???:0
0xeb6739 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

## To quickly reproduce:

https://godbolt.org/z/dTPq4TYTn

Reply via email to