1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// PR c++/106361 // { dg-do compile { target c++20 } } struct foo { int x; }; struct bar { foo f; // { dg-error "operator==" } friend bool operator==(const bar& a, const bar& b); }; bool operator==(const bar& a, const bar& b) = default; int main() { return bar{} == bar{}; // { dg-error "deleted" } }