https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96689
Bug ID: 96689 Summary: Segmentation fault when defaulting operator<=> on enum er enum class Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: breyer.marcel at web dot de Target Milestone: --- Defaulting the default comparison operator (operator<=>) on an enum or enum class causes a segmentation fault. #include <compare> enum class test { one, two, three }; std::strong_ordering operator<=>(const test, const test) = default; Causes on GCC trunk (https://godbolt.org/z/KzxPq3): <source>:9:60: internal compiler error: Segmentation fault 9 | std::strong_ordering operator<=>(const test, const test) = default; | ^~~~~~~ Please submit a full bug report, with preprocessed source if appropriate.