llvm-project/libcxx
Eric Fiselier 4fae50267a [libcxx] [test] In test/support/test_allocator.h, fix construct() to avoid moving immovable types.
Summary:
In test/support/test_allocator.h, fix construct() to avoid moving immovable types.

This improves the allocator's conformance, and fixes compiler errors with MSVC's STL. The scenario is when the allocator is asked to construct an object of type X that's immovable (deleted copy/move ctors), but implicitly constructible from an argument type A. When perfectly forwarded, X can be (explicitly) constructed from A, and everything is fine. That's std::allocator's behavior, and the Standard's default when a user allocator's construct() doesn't exist. The previous implementation of construct() here mishandled this scenario. Passing A to this construct() would implicitly construct an X temporary, bound to (non-templated) T&&. Then construct() would attempt to move-construct X from that X temporary, but X is immovable, boom.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21094

llvm-svn: 272747
2016-06-15 01:53:32 +00:00
..
cmake [CMake] Cleanup uses of USES_TERMINAL 2016-06-08 22:20:28 +00:00
docs Update libcxx.llvm.org documentation by linking to new docs. 2016-06-02 02:16:28 +00:00
include Partially Revert r272613. FreeBSD needs the non-trivial constructors in pair. 2016-06-14 14:34:19 +00:00
lib Automatically detect export lists for OS X. 2016-06-14 21:55:14 +00:00
src Fix syntax error in r272640. 2016-06-14 06:08:10 +00:00
test [libcxx] [test] In test/support/test_allocator.h, fix construct() to avoid moving immovable types. 2016-06-15 01:53:32 +00:00
utils Add more missing license headers 2016-01-19 21:58:49 +00:00
www Implement variadic lock_guard. 2016-06-14 03:48:09 +00:00
.arcconfig Update Arcanist config to point to reviews.llvm.org 2014-06-10 18:29:36 +00:00
.gitignore [libc++] Refactor test components into modules. 2015-01-09 18:03:29 +00:00
CMakeLists.txt [libcxx] Allow target flags to affect CMake configuration tests 2016-06-02 01:10:08 +00:00
CREDITS.TXT Add self to CREDITS.txt 2015-02-26 00:48:22 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:39:53 +00:00
TODO.TXT Test commit to see if libcxx.llvm.org/docs builds 2015-09-04 22:57:00 +00:00