// { dg-do run { target c++20 } } // { dg-require-effective-target hosted } #include #include struct UsesAlloc { using allocator_type = std::allocator; bool passed_alloc; UsesAlloc(int) : passed_alloc(false) { } UsesAlloc(int, std::allocator) : passed_alloc(true) { } }; using Pair = std::pair; void test_const() { std::allocator a; int i = 0; auto p = std::make_obj_using_allocator(a, i, i); VERIFY( p.first.passed_alloc ); } void test_volatile() { std::allocator a; int i = 0; auto p = std::make_obj_using_allocator(a, i, i); VERIFY( p.first.passed_alloc ); } void test_const_volatile() { std::allocator a; int i = 0; auto p = std::make_obj_using_allocator(a, i, i); VERIFY( p.first.passed_alloc ); } int main() { test_const(); test_volatile(); test_const_volatile(); }