[gcn] install.texi: Update for new ISA targets and their requirements
[gcc.git] / gcc / testsuite / g++.dg / cpp23 / constexpr-nonlit15.C
blobaa35fa881894801839384ea4afeb46f331ef3474
1 // PR c++/106649
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.
11 struct S {
12   constexpr S() {}
13   S& operator=(const S&) = default;
14   S& operator=(S&&) = default;
17 struct U {
18   constexpr U& operator=(const U&) = default;
19   constexpr U& operator=(U&&) = default;
22 constexpr void
23 g ()
25   S a;
26   S b;
27   b = a;
28   b = S{};
30   U u, v;
31   u = v;
32   u = U{};
35 static_assert ((g(), true), "");