| 1 |
// PR c++/106649 |
| 2 |
// P2448 - Relaxing some constexpr restrictions |
| 3 |
// { dg-do compile { target c++20 } } |
| 4 |
// { dg-options "" } |
| 5 |
|
| 6 |
template <typename T> |
| 7 |
struct Wrapper { |
| 8 |
constexpr Wrapper() = default; |
| 9 |
constexpr Wrapper(Wrapper const&) = default; |
| 10 |
constexpr Wrapper(T const& t) : t(t) { } |
| 11 |
|
| 12 |
constexpr T get() const { return t; } |
| 13 |
constexpr bool operator==(Wrapper const&) const = default; // { dg-warning "call to" "" { target c++20_down } } |
| 14 |
private: |
| 15 |
T t; |
| 16 |
}; |
| 17 |
|
| 18 |
struct X { |
| 19 |
X(); |
| 20 |
bool operator==(X const&) const; |
| 21 |
}; |
| 22 |
|
| 23 |
Wrapper<X> x; |