diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp --- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp +++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp @@ -111,6 +111,18 @@ bool F::constructed = false; +struct G +{ + static bool constructed; + + typedef std::allocator allocator_type; + + G(std::allocator_arg_t, allocator_type&&) { assert(false); } + G(allocator_type&) { constructed = true; } +}; + +bool G::constructed = false; + int main(int, char**) { @@ -185,6 +197,17 @@ assert(A3::constructed); s->~S(); } + + // LWG 2586 + // Test that is_constructible uses an lvalue ref so the correct constructor + // is picked. + { + std::scoped_allocator_adaptor sa; + G* ptr = sa.allocate(1); + sa.construct(ptr); + assert(G::constructed); + sa.deallocate(ptr, 1); + } return 0; } diff --git a/libcxx/www/cxx1z_status.html b/libcxx/www/cxx1z_status.html --- a/libcxx/www/cxx1z_status.html +++ b/libcxx/www/cxx1z_status.html @@ -308,7 +308,7 @@ 2582§[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traitsJacksonvilleComplete 2583There is no way to supply an allocator for basic_string(str, pos)JacksonvilleComplete 2585forward_list::resize(size_type, const value_type&) effects incorrectJacksonvilleComplete - 2586Wrong value category used in scoped_allocator_adaptor::construct()Jacksonville + 2586Wrong value category used in scoped_allocator_adaptor::construct()JacksonvilleComplete 2590Aggregate initialization for std::arrayJacksonvilleComplete 2181Exceptions from seed sequence operationsOuluComplete