// { dg-do compile { target c++20 } } // TODO [!HOSTED]: avoidable std::allocator usage // { dg-require-effective-target hosted } #include constexpr bool test_pr104542() { // PR libstdc++/104542 - missing constexpr std::allocator a; int* p = a.allocate(1); int i = *std::uninitialized_construct_using_allocator(p, a, 999); a.deallocate(p, 1); return i == 999; } static_assert( test_pr104542() );