Bug #19473. If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -92,6 +92,15 @@ int main()
|
||||
}
|
||||
assert(new_called == 0);
|
||||
{
|
||||
assert(new_called == 0);
|
||||
non_default_test_allocator<std::function<int(int)>> al(1);
|
||||
std::function<int(int)> f2(std::allocator_arg, al, g);
|
||||
assert(new_called == 0);
|
||||
assert(f2.target<int(*)(int)>());
|
||||
assert(f2.target<A>() == 0);
|
||||
}
|
||||
assert(new_called == 0);
|
||||
{
|
||||
std::function<int(int)> f;
|
||||
assert(new_called == 0);
|
||||
assert(f.target<int(*)(int)>() == 0);
|
||||
|
Reference in New Issue
Block a user