[libcxx] r274285 - Fix static assert problem on gcc; remove XFAILs that I put in in r274250

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 15:05:46 PDT 2016


Author: marshall
Date: Thu Jun 30 17:05:45 2016
New Revision: 274285

URL: http://llvm.org/viewvc/llvm-project?rev=274285&view=rev
Log:
Fix static assert problem on gcc; remove XFAILs that I put in in r274250

Modified:
    libcxx/trunk/include/__hash_table
    libcxx/trunk/include/__tree
    libcxx/trunk/test/std/containers/associative/map/incomplete_type.pass.cpp
    libcxx/trunk/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp
    libcxx/trunk/test/std/containers/associative/multimap/incomplete_type.pass.cpp
    libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp

Modified: libcxx/trunk/include/__hash_table
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/include/__hash_table (original)
+++ libcxx/trunk/include/__hash_table Thu Jun 30 17:05:45 2016
@@ -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<key_equal>::value),
-                 "Predicate must be copy-constructible.");
-    static_assert((is_copy_constructible<hasher>::value),
-                 "Hasher must be copy-constructible.");
 
 private:
 
@@ -1479,6 +1475,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
 {
+    static_assert((is_copy_constructible<key_equal>::value),
+                 "Predicate must be copy-constructible.");
+    static_assert((is_copy_constructible<hasher>::value),
+                 "Hasher must be copy-constructible.");
     __deallocate(__p1_.first().__next_);
 #if _LIBCPP_DEBUG_LEVEL >= 2
     __get_db()->__erase_c(this);

Modified: libcxx/trunk/include/__tree
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__tree?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/include/__tree (original)
+++ libcxx/trunk/include/__tree Thu Jun 30 17:05:45 2016
@@ -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_compare>::value),
-                 "Comparator must be copy-constructible.");
 
 private:
     __node_pointer                                     __begin_node_;
@@ -1707,6 +1705,8 @@ __tree<_Tp, _Compare, _Allocator>::opera
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::~__tree()
 {
+    static_assert((is_copy_constructible<value_compare>::value),
+                 "Comparator must be copy-constructible.");
     destroy(__root());
 }
 

Modified: libcxx/trunk/test/std/containers/associative/map/incomplete_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/incomplete_type.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/incomplete_type.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/incomplete_type.pass.cpp Thu Jun 30 17:05:45 2016
@@ -12,8 +12,6 @@
 // Check that std::map and it's iterators can be instantiated with an incomplete
 // type.
 
-// XFAIL: gcc
-
 #include <map>
 
 struct A {

Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp Thu Jun 30 17:05:45 2016
@@ -13,8 +13,6 @@
 
 // map();
 
-// XFAIL: gcc
-
 #include <map>
 
 struct X

Modified: libcxx/trunk/test/std/containers/associative/multimap/incomplete_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/incomplete_type.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/incomplete_type.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/incomplete_type.pass.cpp Thu Jun 30 17:05:45 2016
@@ -12,8 +12,6 @@
 // Check that std::multimap and it's iterators can be instantiated with an incomplete
 // type.
 
-// XFAIL: gcc
-
 #include <map>
 
 struct A {

Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp Thu Jun 30 17:05:45 2016
@@ -13,8 +13,6 @@
 
 // multimap();
 
-// XFAIL: gcc
-
 #include <map>
 
 struct X

Modified: libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.map/incomplete_type.pass.cpp Thu Jun 30 17:05:45 2016
@@ -13,8 +13,6 @@
 // Check that std::unordered_map and it's iterators can be instantiated with an incomplete
 // type.
 
-// XFAIL: gcc
-
 #include <unordered_map>
 
 template <class Tp>

Modified: libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp?rev=274285&r1=274284&r2=274285&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/incomplete.pass.cpp Thu Jun 30 17:05:45 2016
@@ -13,8 +13,6 @@
 // Check that std::unordered_multimap and it's iterators can be instantiated with an incomplete
 // type.
 
-// XFAIL: gcc
-
 #include <unordered_map>
 
 template <class Tp>




More information about the cfe-commits mailing list