c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / spaceship-eq3.C
blob246839f1f955f473e6758cd6da3d2626a1ffaa94
1 // { dg-do compile { target c++20 } }
3 struct A {
4   bool operator==(const A&) const;
5 };
7 struct D
9   A i;
10   bool operator==(const D& x) const = default; // { dg-error "A::operator==" "" { target c++20_down } }
11   bool operator!=(const D& z) const = default; // { dg-error "D::operator==" "" { target c++20_down } }
12 // { dg-error "called" "" { target { c++23 && implicit_constexpr } } .-1 }
15 constexpr D d{A()};
16 static_assert (d == d);         // { dg-error "constant|constexpr" }
17 static_assert (!(d != d));      // { dg-error "constant|constexpr" }