diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2016-08-17 05:58:40 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2016-08-17 05:58:40 +0000 |
commit | d4badbbc5a4c63fa9c644d4ae78ec0e38564c8dc (patch) | |
tree | 79e585c280ce3fd841d070eca8bdb96753dfe06d /test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp | |
parent | ea714e73a6a59da8161762a588b8fd5d28ab45b7 (diff) | |
download | external_libcxx-d4badbbc5a4c63fa9c644d4ae78ec0e38564c8dc.tar.gz external_libcxx-d4badbbc5a4c63fa9c644d4ae78ec0e38564c8dc.tar.bz2 external_libcxx-d4badbbc5a4c63fa9c644d4ae78ec0e38564c8dc.zip |
Support allocators with explicit conversion constructors. Fixes bug #29000
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp')
-rw-r--r-- | test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp index 5253b600b..6caa59728 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp @@ -66,7 +66,25 @@ int main() assert(c.load_factor() == 0); assert(c.max_load_factor() == 1); } -#if _LIBCPP_STD_VER > 11 + { + typedef explicit_allocator<std::pair<const NotConstructible, NotConstructible>> A; + typedef std::unordered_map<NotConstructible, NotConstructible, + test_hash<std::hash<NotConstructible> >, + test_compare<std::equal_to<NotConstructible> >, + A + > C; + C c(A{}); + LIBCPP_ASSERT(c.bucket_count() == 0); + assert(c.hash_function() == test_hash<std::hash<NotConstructible> >()); + assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >()); + assert(c.get_allocator() == A{}); + assert(c.size() == 0); + assert(c.empty()); + assert(std::distance(c.begin(), c.end()) == 0); + assert(c.load_factor() == 0); + assert(c.max_load_factor() == 1); + } +#if TEST_STD_VER > 11 { typedef NotConstructible T; typedef test_allocator<std::pair<const T, T>> A; |