[libcxx] r290474 - fix warnings only produced by apple-clang

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 17:07:55 PST 2016


Author: ericwf
Date: Fri Dec 23 19:07:54 2016
New Revision: 290474

URL: http://llvm.org/viewvc/llvm-project?rev=290474&view=rev
Log:
fix warnings only produced by apple-clang

Modified:
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
    libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
    libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/size.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/size.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/size.pass.cpp Fri Dec 23 19:07:54 2016
@@ -33,12 +33,12 @@ test2(unsigned n)
     assert(static_cast<unsigned>(DefaultOnly::count) == n);
     assert(d.size() == n);
     assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
         assert(*i == T());
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     }
     assert(DefaultOnly::count == 0);
+#else
+    ((void)n);
 #endif
 }
 
@@ -54,10 +54,10 @@ test1(unsigned n)
     assert(static_cast<unsigned>(DefaultOnly::count) == n);
     assert(d.size() == n);
     assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
         assert(*i == T());
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
     }
     assert(DefaultOnly::count == 0);
 }
@@ -74,6 +74,9 @@ test3(unsigned n, Allocator const &alloc
     assert(d.size() == n);
     assert(d.get_allocator() == alloc);
     }
+#else
+    ((void)n);
+    ((void)alloc);
 #endif
 }
 

Modified: libcxx/trunk/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.cons/size_type.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/list.cons/size_type.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/list.cons/size_type.pass.cpp Fri Dec 23 19:07:54 2016
@@ -32,6 +32,9 @@ test3(unsigned n, Allocator const &alloc
     assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == n);
     assert(d.get_allocator() == alloc);
     }
+#else
+    ((void)n);
+    ((void)alloc);
 #endif
 }
 
@@ -76,14 +79,12 @@ int main()
         test3<int, min_allocator<int>> (3);
     }
 #endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         std::list<DefaultOnly> l(3);
         assert(l.size() == 3);
         assert(std::distance(l.begin(), l.end()) == 3);
     }
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
     {
         std::list<int, min_allocator<int>> l(3);
         assert(l.size() == 3);
@@ -95,12 +96,10 @@ int main()
         ++i;
         assert(*i == 0);
     }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::list<DefaultOnly, min_allocator<DefaultOnly>> l(3);
         assert(l.size() == 3);
         assert(std::distance(l.begin(), l.end()) == 3);
     }
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size.pass.cpp Fri Dec 23 19:07:54 2016
@@ -31,6 +31,9 @@ test2(typename C::size_type n,
     assert(c.get_allocator() == a);
     for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
         assert(*i == typename C::value_type());
+#else
+  ((void)n);
+  ((void)a);
 #endif
 }
 

Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp Fri Dec 23 19:07:54 2016
@@ -32,6 +32,9 @@ test2(typename C::size_type n, typename
     LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
     for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
         assert(*i == typename C::value_type());
+#else
+    ((void)n);
+    ((void)a);
 #endif
 }
 

Modified: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp Fri Dec 23 19:07:54 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -30,23 +32,13 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
                                    test_compare<std::equal_to<int> >,
                                    test_allocator<std::pair<const int, std::string> >
                                    > C;
-        typedef std::pair<int, std::string> P;
-        P a[] =
-        {
-            P(1, "one"),
-            P(2, "two"),
-            P(3, "three"),
-            P(4, "four"),
-            P(1, "four"),
-            P(2, "four"),
-        };
+
         C c0(7,
             test_hash<std::hash<int> >(8),
             test_compare<std::equal_to<int> >(9),
@@ -130,23 +122,12 @@ int main()
 
         assert(c0.empty());
     }
-#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
                                    test_compare<std::equal_to<int> >,
                                    min_allocator<std::pair<const int, std::string> >
                                    > C;
-        typedef std::pair<int, std::string> P;
-        P a[] =
-        {
-            P(1, "one"),
-            P(2, "two"),
-            P(3, "three"),
-            P(4, "four"),
-            P(1, "four"),
-            P(2, "four"),
-        };
         C c0(7,
             test_hash<std::hash<int> >(8),
             test_compare<std::equal_to<int> >(9),
@@ -230,7 +211,6 @@ int main()
 
         assert(c0.empty());
     }
-#endif
 #if _LIBCPP_DEBUG >= 1
     {
         std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
@@ -242,5 +222,4 @@ int main()
         assert(s2.size() == 2);
     }
 #endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp Fri Dec 23 19:07:54 2016
@@ -26226,25 +26226,25 @@ int main()
     std::locale lg(lc, new my_numpunct);
     const my_facet f(1);
     {
-        long double v = -INFINITY;
+        long double v = -INFINITY; ((void)v);
     }
     {
-        long double v = std::nan("");
+        long double v = std::nan(""); ((void)v);
     }
 
     {
-        long double v = +0.;
+        long double v = +0.; ((void)v);
     }
     {
-        long double v = -INFINITY;
+        long double v = -INFINITY; ((void)v);
     }
     {
-        long double v = std::nan("");
+        long double v = std::nan(""); ((void)v);
     }
     {
-        long double v = -INFINITY;
+        long double v = -INFINITY; ((void)v);
     }
     {
-        long double v = std::nan("");
+        long double v = std::nan(""); ((void)v);
     }
 }

Modified: libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp Fri Dec 23 19:07:54 2016
@@ -24,7 +24,6 @@ int main()
         typedef std::sub_match<const CharT*> SM;
         typedef SM::string_type string;
         SM sm = SM();
-        SM sm2 = SM();
         assert(sm.compare(string()) == 0);
         const CharT s[] = {'1', '2', '3', 0};
         sm.first = s;
@@ -38,7 +37,6 @@ int main()
         typedef std::sub_match<const CharT*> SM;
         typedef SM::string_type string;
         SM sm = SM();
-        SM sm2 = SM();
         assert(sm.compare(string()) == 0);
         const CharT s[] = {'1', '2', '3', 0};
         sm.first = s;

Modified: libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp?rev=290474&r1=290473&r2=290474&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp Fri Dec 23 19:07:54 2016
@@ -23,7 +23,6 @@ int main()
         typedef char CharT;
         typedef std::sub_match<const CharT*> SM;
         SM sm = SM();
-        SM sm2 = SM();
         assert(sm.compare("") == 0);
         const CharT s[] = {'1', '2', '3', 0};
         sm.first = s;
@@ -36,7 +35,6 @@ int main()
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
         SM sm = SM();
-        SM sm2 = SM();
         assert(sm.compare(L"") == 0);
         const CharT s[] = {'1', '2', '3', 0};
         sm.first = s;




More information about the cfe-commits mailing list