diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-18 21:54:38 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-18 21:54:38 +0000 |
commit | b04c795e24654fc57a94a9032f54ac72e10d0b5e (patch) | |
tree | 909a6470b4bb964e7de917259d34a0d18feb555f /libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func | |
parent | e57a2a31447e009cfe8c503429078e740a8a8448 (diff) | |
download | bcm5719-llvm-b04c795e24654fc57a94a9032f54ac72e10d0b5e.tar.gz bcm5719-llvm-b04c795e24654fc57a94a9032f54ac72e10d0b5e.zip |
[libcxx] [test] D26815: Fix an assumption about the state of moved-from std::functions.
The Standard doesn't provide any guarantees beyond "valid but unspecified" for
moved-from std::functions. libcxx moves from small targets and leaves them
there, while MSVC's STL empties out the source. Mark these assertions as
libcxx-specific.
llvm-svn: 287382
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func')
-rw-r--r-- | libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp index 387b371a933..9d5681a3db7 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp @@ -132,7 +132,7 @@ int main() assert(A::count == 1); assert(f2.target<A>() == nullptr); assert(f2.target<Ref>()); - assert(f.target<Ref>()); // f is unchanged because the target is small + LIBCPP_ASSERT(f.target<Ref>()); // f is unchanged because the target is small } { // Test that moving a function constructed from a function pointer @@ -146,7 +146,7 @@ int main() std::function<int(int)> f2(std::move(f)); assert(f2.target<A>() == nullptr); assert(f2.target<Ptr>()); - assert(f.target<Ptr>()); // f is unchanged because the target is small + LIBCPP_ASSERT(f.target<Ptr>()); // f is unchanged because the target is small } #endif // TEST_STD_VER >= 11 } |