c++: P2448 - Relaxing some constexpr restrictions [PR106649]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / spaceship-eq3.C
blob69eaa7b9b209d274772097334dfeafeb2ea75818
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 } }
14 constexpr D d{A()};
15 static_assert (d == d);         // { dg-error "constant|constexpr" }
16 static_assert (!(d != d));      // { dg-error "constant|constexpr" }