[libcxx] r212538 - Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.

Marshall Clow mclow.lists at gmail.com
Tue Jul 8 08:19:40 PDT 2014


Author: marshall
Date: Tue Jul  8 10:19:40 2014
New Revision: 212538

URL: http://llvm.org/viewvc/llvm-project?rev=212538&view=rev
Log:
Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.

Modified:
    libcxx/trunk/test/containers/associative/map/types.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/types.pass.cpp
    libcxx/trunk/test/containers/associative/multiset/types.pass.cpp
    libcxx/trunk/test/containers/associative/set/types.pass.cpp
    libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
    libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
    libcxx/trunk/test/containers/sequences/deque/types.pass.cpp
    libcxx/trunk/test/containers/sequences/forwardlist/types.pass.cpp
    libcxx/trunk/test/containers/unord/unord.map/types.pass.cpp
    libcxx/trunk/test/containers/unord/unord.multimap/types.pass.cpp
    libcxx/trunk/test/containers/unord/unord.multiset/types.pass.cpp
    libcxx/trunk/test/containers/unord/unord.set/types.pass.cpp

Modified: libcxx/trunk/test/containers/associative/map/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -37,31 +37,34 @@
 int main()
 {
     {
-    static_assert((std::is_same<std::map<int, double>::key_type, int>::value), "");
-    static_assert((std::is_same<std::map<int, double>::mapped_type, double>::value), "");
-    static_assert((std::is_same<std::map<int, double>::value_type, std::pair<const int, double> >::value), "");
-    static_assert((std::is_same<std::map<int, double>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::map<int, double>::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
-    static_assert((std::is_same<std::map<int, double>::reference, std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::map<int, double>::const_reference, const std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::map<int, double>::pointer, std::pair<const int, double>*>::value), "");
-    static_assert((std::is_same<std::map<int, double>::const_pointer, const std::pair<const int, double>*>::value), "");
-    static_assert((std::is_same<std::map<int, double>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::map<int, double>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::map<int, double> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::mapped_type, double>::value), "");
+    static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
+    static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::pointer, std::pair<const int, double>*>::value), "");
+    static_assert((std::is_same<C::const_pointer, const std::pair<const int, double>*>::value), "");
+    static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #if __cplusplus >= 201103L
     {
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_type, int>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::mapped_type, double>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::value_type, std::pair<const int, double> >::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::reference, std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_reference, const std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::pointer, min_pointer<std::pair<const int, double>>>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::mapped_type, double>::value), "");
+    static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
+    static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::pointer, min_pointer<std::pair<const int, double>>>::value), "");
+    static_assert((std::is_same<C::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+    static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif
 }

Modified: libcxx/trunk/test/containers/associative/multimap/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -37,31 +37,34 @@
 int main()
 {
     {
-    static_assert((std::is_same<std::multimap<int, double>::key_type, int>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::mapped_type, double>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::value_type, std::pair<const int, double> >::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::reference, std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::const_reference, const std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::pointer, std::pair<const int, double>*>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::const_pointer, const std::pair<const int, double>*>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::multimap<int, double>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::multimap<int, double> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::mapped_type, double>::value), "");
+    static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
+    static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::pointer, std::pair<const int, double>*>::value), "");
+    static_assert((std::is_same<C::const_pointer, const std::pair<const int, double>*>::value), "");
+    static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #if __cplusplus >= 201103L
     {
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_type, int>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::mapped_type, double>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::value_type, std::pair<const int, double> >::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::reference, std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_reference, const std::pair<const int, double>&>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::pointer, min_pointer<std::pair<const int, double>>>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::mapped_type, double>::value), "");
+    static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
+    static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
+    static_assert((std::is_same<C::pointer, min_pointer<std::pair<const int, double>>>::value), "");
+    static_assert((std::is_same<C::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+    static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif
 }

Modified: libcxx/trunk/test/containers/associative/multiset/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multiset/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -37,31 +37,34 @@
 int main()
 {
     {
-    static_assert((std::is_same<std::multiset<int>::key_type, int>::value), "");
-    static_assert((std::is_same<std::multiset<int>::value_type, int>::value), "");
-    static_assert((std::is_same<std::multiset<int>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multiset<int>::value_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multiset<int>::allocator_type, std::allocator<int> >::value), "");
-    static_assert((std::is_same<std::multiset<int>::reference, int&>::value), "");
-    static_assert((std::is_same<std::multiset<int>::const_reference, const int&>::value), "");
-    static_assert((std::is_same<std::multiset<int>::pointer, int*>::value), "");
-    static_assert((std::is_same<std::multiset<int>::const_pointer, const int*>::value), "");
-    static_assert((std::is_same<std::multiset<int>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::multiset<int>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::multiset<int> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::value_type, int>::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
+    static_assert((std::is_same<C::reference, int&>::value), "");
+    static_assert((std::is_same<C::const_reference, const int&>::value), "");
+    static_assert((std::is_same<C::pointer, int*>::value), "");
+    static_assert((std::is_same<C::const_pointer, const int*>::value), "");
+    static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #if __cplusplus >= 201103L
     {
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::key_type, int>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::value_type, int>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::value_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::allocator_type, min_allocator<int>>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::reference, int&>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::const_reference, const int&>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::value_type, int>::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, min_allocator<int>>::value), "");
+    static_assert((std::is_same<C::reference, int&>::value), "");
+    static_assert((std::is_same<C::const_reference, const int&>::value), "");
+    static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
+    static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+    static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif
 }

Modified: libcxx/trunk/test/containers/associative/set/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/set/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/set/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -37,31 +37,34 @@
 int main()
 {
     {
-    static_assert((std::is_same<std::set<int>::key_type, int>::value), "");
-    static_assert((std::is_same<std::set<int>::value_type, int>::value), "");
-    static_assert((std::is_same<std::set<int>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::set<int>::value_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::set<int>::allocator_type, std::allocator<int> >::value), "");
-    static_assert((std::is_same<std::set<int>::reference, int&>::value), "");
-    static_assert((std::is_same<std::set<int>::const_reference, const int&>::value), "");
-    static_assert((std::is_same<std::set<int>::pointer, int*>::value), "");
-    static_assert((std::is_same<std::set<int>::const_pointer, const int*>::value), "");
-    static_assert((std::is_same<std::set<int>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::set<int>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::set<int> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::value_type, int>::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
+    static_assert((std::is_same<C::reference, int&>::value), "");
+    static_assert((std::is_same<C::const_reference, const int&>::value), "");
+    static_assert((std::is_same<C::pointer, int*>::value), "");
+    static_assert((std::is_same<C::const_pointer, const int*>::value), "");
+    static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #if __cplusplus >= 201103L
     {
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::key_type, int>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::value_type, int>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::key_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::value_compare, std::less<int> >::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::allocator_type, min_allocator<int> >::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::reference, int&>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::const_reference, const int&>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::difference_type, std::ptrdiff_t>::value), "");
+    typedef std::set<int, std::less<int>, min_allocator<int>> C;
+    static_assert((std::is_same<C::key_type, int>::value), "");
+    static_assert((std::is_same<C::value_type, int>::value), "");
+    static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
+    static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
+    static_assert((std::is_same<C::reference, int&>::value), "");
+    static_assert((std::is_same<C::const_reference, const int&>::value), "");
+    static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
+    static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+    static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif
 }

Modified: libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size.pass.cpp Tue Jul  8 10:19:40 2014
@@ -43,7 +43,7 @@ void
 test(C& c1, int size)
 {
     typedef typename C::const_iterator CI;
-    std::size_t c1_osize = c1.size();
+    typename C::size_type c1_osize = c1.size();
     c1.resize(size);
     assert(c1.size() == size);
     assert(distance(c1.begin(), c1.end()) == c1.size());

Modified: libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp Tue Jul  8 10:19:40 2014
@@ -43,7 +43,7 @@ void
 test(C& c1, int size, int x)
 {
     typedef typename C::const_iterator CI;
-    std::size_t c1_osize = c1.size();
+    typename C::size_type c1_osize = c1.size();
     c1.resize(size, x);
     assert(c1.size() == size);
     assert(distance(c1.begin(), c1.end()) == c1.size());

Modified: libcxx/trunk/test/containers/sequences/deque/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/deque/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/deque/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/deque/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -82,7 +82,8 @@ int main()
         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
         static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
         static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
-        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif

Modified: libcxx/trunk/test/containers/sequences/forwardlist/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/forwardlist/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/forwardlist/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/forwardlist/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -32,22 +32,29 @@
 
 int main()
 {
-    static_assert((std::is_same<std::forward_list<char>::value_type, char>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::allocator_type, std::allocator<char> >::value), "");
-    static_assert((std::is_same<std::forward_list<char>::reference, char&>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::const_reference, const char&>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::pointer, char*>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::const_pointer, const char*>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::forward_list<char>::difference_type, std::ptrdiff_t>::value), "");
+    {
+    typedef std::forward_list<char> C;
+    static_assert((std::is_same<C::value_type, char>::value), "");
+    static_assert((std::is_same<C::allocator_type, std::allocator<char> >::value), "");
+    static_assert((std::is_same<C::reference, char&>::value), "");
+    static_assert((std::is_same<C::const_reference, const char&>::value), "");
+    static_assert((std::is_same<C::pointer, char*>::value), "");
+    static_assert((std::is_same<C::const_pointer, const char*>::value), "");
+    static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
 #if __cplusplus >= 201103L
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::value_type, char>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::allocator_type, min_allocator<char> >::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::reference, char&>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::const_reference, const char&>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::pointer, min_pointer<char>>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::const_pointer, min_pointer<const char>>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::size_type, std::size_t>::value), "");
-    static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::difference_type, std::ptrdiff_t>::value), "");
+    {
+    typedef std::forward_list<char, min_allocator<char>> C;
+    static_assert((std::is_same<C::value_type, char>::value), "");
+    static_assert((std::is_same<C::allocator_type, min_allocator<char> >::value), "");
+    static_assert((std::is_same<C::reference, char&>::value), "");
+    static_assert((std::is_same<C::const_reference, const char&>::value), "");
+    static_assert((std::is_same<C::pointer, min_pointer<char>>::value), "");
+    static_assert((std::is_same<C::const_pointer, min_pointer<const char>>::value), "");
+//  min_allocator doesn't have a size_type, so one gets synthesized
+    static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+    static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
 #endif
 }

Modified: libcxx/trunk/test/containers/unord/unord.map/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.map/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.map/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.map/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -64,7 +64,8 @@ int main()
         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
         static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
         static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
-        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif

Modified: libcxx/trunk/test/containers/unord/unord.multimap/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.multimap/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.multimap/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.multimap/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -64,7 +64,8 @@ int main()
         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
         static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
         static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
-        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif

Modified: libcxx/trunk/test/containers/unord/unord.multiset/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.multiset/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.multiset/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.multiset/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -61,7 +61,8 @@ int main()
         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
         static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
         static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
-        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif

Modified: libcxx/trunk/test/containers/unord/unord.set/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.set/types.pass.cpp?rev=212538&r1=212537&r2=212538&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.set/types.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.set/types.pass.cpp Tue Jul  8 10:19:40 2014
@@ -61,7 +61,8 @@ int main()
         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
         static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
         static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
-        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     }
 #endif





More information about the cfe-commits mailing list