https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92966
Bug ID: 92966 Summary: Segfault on defaulted operator== with wrong return type Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: arthur.j.odwyer at gmail dot com Target Milestone: --- cat >test.cc <<EOF struct S3 { int operator==(const S3&) const = default; }; static_assert(S3{} == S3{}); EOF g++ -std=c++2a test.cc test.cc:2:9: error: defaulted 'int S3::operator==(const S3&) const' must return 'bool' 2 | int operator==(const S3&) const = default; | ^~~~~~~~ test.cc: In member function 'constexpr int S3::operator==(const S3&) const': test.cc:2:9: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions.