From 3b8669edbf3f8565309432126a6a3a1a7259a568 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 30 Jun 2016 22:05:45 +0000 Subject: [PATCH] Fix static assert problem on gcc; remove XFAILs that I put in in r274250 llvm-svn: 274285 --- libcxx/include/__hash_table | 8 ++++---- libcxx/include/__tree | 4 ++-- .../containers/associative/map/incomplete_type.pass.cpp | 2 -- .../associative/map/map.cons/default_recursive.pass.cpp | 2 -- .../associative/multimap/incomplete_type.pass.cpp | 2 -- .../multimap/multimap.cons/default_recursive.pass.cpp | 2 -- .../containers/unord/unord.map/incomplete_type.pass.cpp | 2 -- .../containers/unord/unord.multimap/incomplete.pass.cpp | 2 -- 8 files changed, 6 insertions(+), 18 deletions(-) diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index 86cd9315dd7a..6b93e848d5c5 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -938,10 +938,6 @@ private: typedef allocator_traits<__node_base_allocator> __node_base_traits; static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), "Allocator does not rebind pointers in a sane manner."); - static_assert((is_copy_constructible::value), - "Predicate must be copy-constructible."); - static_assert((is_copy_constructible::value), - "Hasher must be copy-constructible."); private: @@ -1479,6 +1475,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u, template __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() { + static_assert((is_copy_constructible::value), + "Predicate must be copy-constructible."); + static_assert((is_copy_constructible::value), + "Hasher must be copy-constructible."); __deallocate(__p1_.first().__next_); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__erase_c(this); diff --git a/libcxx/include/__tree b/libcxx/include/__tree index e4863a02a561..52166baef9f2 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -946,8 +946,6 @@ private: typedef allocator_traits<__node_base_allocator> __node_base_traits; static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), "Allocator does not rebind pointers in a sane manner."); - static_assert((is_copy_constructible::value), - "Comparator must be copy-constructible."); private: __node_pointer __begin_node_; @@ -1707,6 +1705,8 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t) template __tree<_Tp, _Compare, _Allocator>::~__tree() { + static_assert((is_copy_constructible::value), + "Comparator must be copy-constructible."); destroy(__root()); } diff --git a/libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp b/libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp index 341ea2e3e125..84c2451ce087 100644 --- a/libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp +++ b/libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp @@ -12,8 +12,6 @@ // Check that std::map and it's iterators can be instantiated with an incomplete // type. -// XFAIL: gcc - #include struct A { diff --git a/libcxx/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp index 813db0bb5702..b4b72725fd6e 100644 --- a/libcxx/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp @@ -13,8 +13,6 @@ // map(); -// XFAIL: gcc - #include struct X diff --git a/libcxx/test/std/containers/associative/multimap/incomplete_type.pass.cpp b/libcxx/test/std/containers/associative/multimap/incomplete_type.pass.cpp index 5663e5dc0b05..c461eb38139d 100644 --- a/libcxx/test/std/containers/associative/multimap/incomplete_type.pass.cpp +++ b/libcxx/test/std/containers/associative/multimap/incomplete_type.pass.cpp @@ -12,8 +12,6 @@ // Check that std::multimap and it's iterators can be instantiated with an incomplete // type. -// XFAIL: gcc - #include struct A { diff --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp index 092bc8ccc61d..08ca8a441e3b 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp +++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp @@ -13,8 +13,6 @@ // multimap(); -// XFAIL: gcc - #include struct X diff --git a/libcxx/test/std/containers/unord/unord.map/incomplete_type.pass.cpp b/libcxx/test/std/containers/unord/unord.map/incomplete_type.pass.cpp index ce28c7ac88cc..d51b1d8d181f 100644 --- a/libcxx/test/std/containers/unord/unord.map/incomplete_type.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/incomplete_type.pass.cpp @@ -13,8 +13,6 @@ // Check that std::unordered_map and it's iterators can be instantiated with an incomplete // type. -// XFAIL: gcc - #include template diff --git a/libcxx/test/std/containers/unord/unord.multimap/incomplete.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/incomplete.pass.cpp index 65940de5e438..7822224e7366 100644 --- a/libcxx/test/std/containers/unord/unord.multimap/incomplete.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/incomplete.pass.cpp @@ -13,8 +13,6 @@ // Check that std::unordered_multimap and it's iterators can be instantiated with an incomplete // type. -// XFAIL: gcc - #include template