diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2014-04-18 17:23:36 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2014-04-18 17:23:36 +0000 |
commit | 5f7c2db2ceae312498634bd521ef64a69a6e2545 (patch) | |
tree | ad324e2e2c4bead2bdbe92d0b5c171c5611f090c /libcxx/test/utilities/function.objects/func.wrap | |
parent | f8361d127a92b81126a5370b50944bef169fbcff (diff) | |
download | bcm5719-llvm-5f7c2db2ceae312498634bd521ef64a69a6e2545.tar.gz bcm5719-llvm-5f7c2db2ceae312498634bd521ef64a69a6e2545.zip |
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
llvm-svn: 206623
Diffstat (limited to 'libcxx/test/utilities/function.objects/func.wrap')
-rw-r--r-- | libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp index 79fc1512ac5..f758a4d8cfe 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp @@ -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); |