diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2014-03-10 04:50:10 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2014-03-10 04:50:10 +0000 |
| commit | 415a24e41f581fad0b021f9556bc68160c876501 (patch) | |
| tree | 6750463b2392a597dda68c3b234eae0f569ad383 | |
| parent | 6ff5aa7c87239a3182b916988259b9c3cd26afc0 (diff) | |
| download | bcm5719-llvm-415a24e41f581fad0b021f9556bc68160c876501.tar.gz bcm5719-llvm-415a24e41f581fad0b021f9556bc68160c876501.zip | |
Fix bug I introduced (enabling implicit conversions from compare function to map) in r202994. Thanks to Sebastian Redl for the catch.
llvm-svn: 203443
| -rw-r--r-- | libcxx/include/map | 20 | ||||
| -rw-r--r-- | libcxx/include/set | 22 |
2 files changed, 38 insertions, 4 deletions
diff --git a/libcxx/include/map b/libcxx/include/map index 16127a5d76b..f533d8f4b8a 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -835,7 +835,15 @@ public: typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - map(const key_compare& __comp = key_compare()) + map() + _NOEXCEPT_( + is_nothrow_default_constructible<allocator_type>::value && + is_nothrow_default_constructible<key_compare>::value && + is_nothrow_copy_constructible<key_compare>::value) + : __tree_(__vc(key_compare())) {} + + _LIBCPP_INLINE_VISIBILITY + explicit map(const key_compare& __comp) _NOEXCEPT_( is_nothrow_default_constructible<allocator_type>::value && is_nothrow_default_constructible<key_compare>::value && @@ -1568,7 +1576,15 @@ public: typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - multimap(const key_compare& __comp = key_compare()) + multimap() + _NOEXCEPT_( + is_nothrow_default_constructible<allocator_type>::value && + is_nothrow_default_constructible<key_compare>::value && + is_nothrow_copy_constructible<key_compare>::value) + : __tree_(__vc(key_compare())) {} + + _LIBCPP_INLINE_VISIBILITY + explicit multimap(const key_compare& __comp) _NOEXCEPT_( is_nothrow_default_constructible<allocator_type>::value && is_nothrow_default_constructible<key_compare>::value && diff --git a/libcxx/include/set b/libcxx/include/set index f093b1896a3..7dbf97095e2 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -425,12 +425,21 @@ public: typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - set(const value_compare& __comp = value_compare()) + set() + _NOEXCEPT_( + is_nothrow_default_constructible<allocator_type>::value && + is_nothrow_default_constructible<key_compare>::value && + is_nothrow_copy_constructible<key_compare>::value) + : __tree_(value_compare()) {} + + _LIBCPP_INLINE_VISIBILITY + explicit set(const value_compare& __comp) _NOEXCEPT_( is_nothrow_default_constructible<allocator_type>::value && is_nothrow_default_constructible<key_compare>::value && is_nothrow_copy_constructible<key_compare>::value) : __tree_(__comp) {} + _LIBCPP_INLINE_VISIBILITY explicit set(const value_compare& __comp, const allocator_type& __a) : __tree_(__comp, __a) {} @@ -822,12 +831,21 @@ public: // construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY - multiset(const value_compare& __comp = value_compare()) + multiset() + _NOEXCEPT_( + is_nothrow_default_constructible<allocator_type>::value && + is_nothrow_default_constructible<key_compare>::value && + is_nothrow_copy_constructible<key_compare>::value) + : __tree_(value_compare()) {} + + _LIBCPP_INLINE_VISIBILITY + explicit multiset(const value_compare& __comp) _NOEXCEPT_( is_nothrow_default_constructible<allocator_type>::value && is_nothrow_default_constructible<key_compare>::value && is_nothrow_copy_constructible<key_compare>::value) : __tree_(__comp) {} + _LIBCPP_INLINE_VISIBILITY explicit multiset(const value_compare& __comp, const allocator_type& __a) : __tree_(__comp, __a) {} |

