[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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user