// { dg-do compile { target c++20 } } #include // PR libstdc++/102270 - std::tuple<>::swap missing constexpr specifier constexpr bool swap_empty_tuple() { std::tuple<> t, u; t.swap(u); return true; } static_assert( swap_empty_tuple() ); #include constexpr bool construct_using_allocator() { using Alloc = __gnu_test::SimpleAllocator; Alloc a; const int i = 0; struct X0a { using allocator_type = Alloc; /* not constexpr */ X0a() { } constexpr X0a(allocator_type) { } }; std::tuple t0a(std::allocator_arg, a); std::tuple t00a(std::allocator_arg, a); struct X0b { using allocator_type = Alloc; /* not constexpr */ X0b() { } constexpr X0b(std::allocator_arg_t, allocator_type) { } }; std::tuple t0b(std::allocator_arg, a); std::tuple t00b(std::allocator_arg, a); struct X1a { using allocator_type = Alloc; /* not constexpr */ X1a(int) { } constexpr X1a(int, allocator_type) { } }; std::tuple t1a(std::allocator_arg, a, 1); std::tuple t11a(std::allocator_arg, a, 1, i); struct X1b { using allocator_type = Alloc; /* not constexpr */ X1b(int) { } constexpr X1b(std::allocator_arg_t, allocator_type, int) { } }; std::tuple t1b(std::allocator_arg, a, 1); std::tuple t11b(std::allocator_arg, a, 1, i); std::tuple t1a1b(std::allocator_arg, a, 1, i, 1, i); const int c = 0; std::tuple tii(std::allocator_arg, a, c, c); return true; } static_assert( construct_using_allocator() );