diff --git a/libcxx/include/deque b/libcxx/include/deque index f099000b137c..9b256b74d4f2 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -1208,7 +1208,7 @@ public: deque() _NOEXCEPT_(is_nothrow_default_constructible::value) {} - _LIBCPP_INLINE_VISIBILITY deque(const allocator_type& __a) : __base(__a) {} + _LIBCPP_INLINE_VISIBILITY explicit deque(const allocator_type& __a) : __base(__a) {} explicit deque(size_type __n); #if _LIBCPP_STD_VER > 11 explicit deque(size_type __n, const _Allocator& __a); diff --git a/libcxx/include/map b/libcxx/include/map index 9779b70e2122..16127a5d76bc 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -835,7 +835,7 @@ public: typedef _VSTD::reverse_iterator const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - explicit map(const key_compare& __comp = key_compare()) + map(const key_compare& __comp = key_compare()) _NOEXCEPT_( is_nothrow_default_constructible::value && is_nothrow_default_constructible::value && @@ -1568,7 +1568,7 @@ public: typedef _VSTD::reverse_iterator const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - explicit multimap(const key_compare& __comp = key_compare()) + multimap(const key_compare& __comp = key_compare()) _NOEXCEPT_( is_nothrow_default_constructible::value && is_nothrow_default_constructible::value && diff --git a/libcxx/include/set b/libcxx/include/set index a537c5fe3457..f093b1896a30 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -425,14 +425,14 @@ public: typedef _VSTD::reverse_iterator const_reverse_iterator; _LIBCPP_INLINE_VISIBILITY - explicit set(const value_compare& __comp = value_compare()) + set(const value_compare& __comp = value_compare()) _NOEXCEPT_( is_nothrow_default_constructible::value && is_nothrow_default_constructible::value && is_nothrow_copy_constructible::value) : __tree_(__comp) {} _LIBCPP_INLINE_VISIBILITY - set(const value_compare& __comp, const allocator_type& __a) + explicit set(const value_compare& __comp, const allocator_type& __a) : __tree_(__comp, __a) {} template _LIBCPP_INLINE_VISIBILITY @@ -822,14 +822,14 @@ public: // construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY - explicit multiset(const value_compare& __comp = value_compare()) + multiset(const value_compare& __comp = value_compare()) _NOEXCEPT_( is_nothrow_default_constructible::value && is_nothrow_default_constructible::value && is_nothrow_copy_constructible::value) : __tree_(__comp) {} _LIBCPP_INLINE_VISIBILITY - multiset(const value_compare& __comp, const allocator_type& __a) + explicit multiset(const value_compare& __comp, const allocator_type& __a) : __tree_(__comp, __a) {} template _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/test/containers/associative/map/map.cons/default.pass.cpp b/libcxx/test/containers/associative/map/map.cons/default.pass.cpp index 2c6908e7b38e..1832a32fffb3 100644 --- a/libcxx/test/containers/associative/map/map.cons/default.pass.cpp +++ b/libcxx/test/containers/associative/map/map.cons/default.pass.cpp @@ -31,5 +31,10 @@ int main() assert(m.empty()); assert(m.begin() == m.end()); } + { + std::map m = {}; + assert(m.empty()); + assert(m.begin() == m.end()); + } #endif } diff --git a/libcxx/test/containers/associative/multimap/multimap.cons/default.pass.cpp b/libcxx/test/containers/associative/multimap/multimap.cons/default.pass.cpp index 2651d90a6fdf..1c3ab8ce6c4b 100644 --- a/libcxx/test/containers/associative/multimap/multimap.cons/default.pass.cpp +++ b/libcxx/test/containers/associative/multimap/multimap.cons/default.pass.cpp @@ -31,5 +31,10 @@ int main() assert(m.empty()); assert(m.begin() == m.end()); } + { + std::multimap m = {}; + assert(m.empty()); + assert(m.begin() == m.end()); + } #endif } diff --git a/libcxx/test/containers/associative/multiset/multiset.cons/default.pass.cpp b/libcxx/test/containers/associative/multiset/multiset.cons/default.pass.cpp index b6176c92d2a2..5bb0312f012b 100644 --- a/libcxx/test/containers/associative/multiset/multiset.cons/default.pass.cpp +++ b/libcxx/test/containers/associative/multiset/multiset.cons/default.pass.cpp @@ -31,5 +31,10 @@ int main() assert(m.empty()); assert(m.begin() == m.end()); } + { + std::multiset m = {}; + assert(m.empty()); + assert(m.begin() == m.end()); + } #endif } diff --git a/libcxx/test/containers/associative/set/set.cons/default.pass.cpp b/libcxx/test/containers/associative/set/set.cons/default.pass.cpp index d047b12a9d17..746a2d173071 100644 --- a/libcxx/test/containers/associative/set/set.cons/default.pass.cpp +++ b/libcxx/test/containers/associative/set/set.cons/default.pass.cpp @@ -31,5 +31,10 @@ int main() assert(m.empty()); assert(m.begin() == m.end()); } + { + std::set m = {}; + assert(m.empty()); + assert(m.begin() == m.end()); + } #endif } diff --git a/libcxx/test/containers/sequences/deque/deque.cons/default.pass.cpp b/libcxx/test/containers/sequences/deque/deque.cons/default.pass.cpp index f8754f1df158..b725dade70b2 100644 --- a/libcxx/test/containers/sequences/deque/deque.cons/default.pass.cpp +++ b/libcxx/test/containers/sequences/deque/deque.cons/default.pass.cpp @@ -24,6 +24,10 @@ test() { std::deque d; assert(d.size() == 0); +#if __cplusplus >= 201103L + std::deque d1 = {}; + assert(d1.size() == 0); +#endif } int main() diff --git a/libcxx/test/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp b/libcxx/test/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp index dcc438c3ed2d..38e95fad8396 100644 --- a/libcxx/test/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp +++ b/libcxx/test/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp @@ -31,5 +31,11 @@ int main() C c; assert(c.empty()); } + { + typedef int T; + typedef std::forward_list C; + C c = {}; + assert(c.empty()); + } #endif } diff --git a/libcxx/test/containers/sequences/list/list.cons/default.pass.cpp b/libcxx/test/containers/sequences/list/list.cons/default.pass.cpp index 6962d28a5964..c05bd74ca79e 100644 --- a/libcxx/test/containers/sequences/list/list.cons/default.pass.cpp +++ b/libcxx/test/containers/sequences/list/list.cons/default.pass.cpp @@ -49,5 +49,10 @@ int main() assert(l.size() == 0); assert(std::distance(l.begin(), l.end()) == 0); } + { + std::list l = {}; + assert(l.size() == 0); + assert(std::distance(l.begin(), l.end()) == 0); + } #endif } diff --git a/libcxx/test/containers/sequences/vector.bool/construct_default.pass.cpp b/libcxx/test/containers/sequences/vector.bool/construct_default.pass.cpp index 51ecbb1d2763..d3d6670bbf22 100644 --- a/libcxx/test/containers/sequences/vector.bool/construct_default.pass.cpp +++ b/libcxx/test/containers/sequences/vector.bool/construct_default.pass.cpp @@ -26,6 +26,12 @@ test0() assert(c.__invariants()); assert(c.empty()); assert(c.get_allocator() == typename C::allocator_type()); +#if __cplusplus >= 201103L + C c1 = {}; + assert(c1.__invariants()); + assert(c1.empty()); + assert(c1.get_allocator() == typename C::allocator_type()); +#endif } template diff --git a/libcxx/test/containers/sequences/vector/vector.cons/construct_default.pass.cpp b/libcxx/test/containers/sequences/vector/vector.cons/construct_default.pass.cpp index f8b66f4b6dae..48c8cf810b5e 100644 --- a/libcxx/test/containers/sequences/vector/vector.cons/construct_default.pass.cpp +++ b/libcxx/test/containers/sequences/vector/vector.cons/construct_default.pass.cpp @@ -27,6 +27,12 @@ test0() assert(c.__invariants()); assert(c.empty()); assert(c.get_allocator() == typename C::allocator_type()); +#if __cplusplus >= 201103L + C c1 = {}; + assert(c1.__invariants()); + assert(c1.empty()); + assert(c1.get_allocator() == typename C::allocator_type()); +#endif } template diff --git a/libcxx/test/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp b/libcxx/test/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp index 622ce5061c16..fa0105604f15 100644 --- a/libcxx/test/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp +++ b/libcxx/test/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp @@ -86,7 +86,7 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C *p = &c; - c = *p; + c = *p; assert(c.size() == 4); assert(std::is_permutation(c.begin(), c.end(), a)); } diff --git a/libcxx/test/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp b/libcxx/test/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp index 42f1faaeade3..a0825db1ecd2 100644 --- a/libcxx/test/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp +++ b/libcxx/test/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp @@ -65,5 +65,14 @@ int main() assert(c.load_factor() == 0); assert(c.max_load_factor() == 1); } + { + std::unordered_map c = {}; + assert(c.bucket_count() == 0); + 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); + } #endif } diff --git a/libcxx/test/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp b/libcxx/test/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp index b7a01a458d57..1884065ce0c8 100644 --- a/libcxx/test/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp +++ b/libcxx/test/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp @@ -65,5 +65,14 @@ int main() assert(c.load_factor() == 0); assert(c.max_load_factor() == 1); } + { + std::unordered_multimap c = {}; + assert(c.bucket_count() == 0); + 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); + } #endif } diff --git a/libcxx/test/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp b/libcxx/test/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp index 6726bc127fbc..737ae2dae793 100644 --- a/libcxx/test/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp +++ b/libcxx/test/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp @@ -61,5 +61,14 @@ int main() assert(c.load_factor() == 0); assert(c.max_load_factor() == 1); } + { + std::unordered_multiset c = {}; + assert(c.bucket_count() == 0); + 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); + } #endif } diff --git a/libcxx/test/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp b/libcxx/test/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp index ee901fb1c1f2..6efa9ed8d1de 100644 --- a/libcxx/test/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp +++ b/libcxx/test/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp @@ -61,5 +61,14 @@ int main() assert(c.load_factor() == 0); assert(c.max_load_factor() == 1); } + { + std::unordered_set c = {}; + assert(c.bucket_count() == 0); + 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); + } #endif }