From 1a93312404841a91c62e27819daf0479d82246ea 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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274285 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__hash_table | 8 ++++---- 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/include/__hash_table b/include/__hash_table index 86cd9315d..6b93e848d 100644 --- a/include/__hash_table +++ b/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/include/__tree b/include/__tree index e4863a02a..52166baef 100644 --- a/include/__tree +++ b/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/test/std/containers/associative/map/incomplete_type.pass.cpp b/test/std/containers/associative/map/incomplete_type.pass.cpp index 341ea2e3e..84c2451ce 100644 --- a/test/std/containers/associative/map/incomplete_type.pass.cpp +++ b/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/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp b/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp index 813db0bb5..b4b72725f 100644 --- a/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp +++ b/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp @@ -13,8 +13,6 @@ // map(); -// XFAIL: gcc - #include struct X diff --git a/test/std/containers/associative/multimap/incomplete_type.pass.cpp b/test/std/containers/associative/multimap/incomplete_type.pass.cpp index 5663e5dc0..c461eb381 100644 --- a/test/std/containers/associative/multimap/incomplete_type.pass.cpp +++ b/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/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp index 092bc8ccc..08ca8a441 100644 --- a/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp @@ -13,8 +13,6 @@ // multimap(); -// XFAIL: gcc - #include struct X diff --git a/test/std/containers/unord/unord.map/incomplete_type.pass.cpp b/test/std/containers/unord/unord.map/incomplete_type.pass.cpp index ce28c7ac8..d51b1d8d1 100644 --- a/test/std/containers/unord/unord.map/incomplete_type.pass.cpp +++ b/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/test/std/containers/unord/unord.multimap/incomplete.pass.cpp b/test/std/containers/unord/unord.multimap/incomplete.pass.cpp index 65940de5e..7822224e7 100644 --- a/test/std/containers/unord/unord.multimap/incomplete.pass.cpp +++ b/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