2 // P2448 - Relaxing some constexpr restrictions
3 // { dg-do compile { target c++23 } }
4 // { dg-options "-Winvalid-constexpr" }
5 // A copy/move assignment operator for a class X that is defaulted and
6 // not defined as deleted is implicitly defined when it is odr-used,
7 // when it is needed for constant evaluation, or when it is explicitly
8 // defaulted after its first declaration.
9 // The implicitly-defined copy/move assignment operator is constexpr.
13 S& operator=(const S&) = default;
14 S& operator=(S&&) = default;
18 constexpr U& operator=(const U&) = default;
19 constexpr U& operator=(U&&) = default;
35 static_assert ((g(), true), "");