diff options
Diffstat (limited to 'libcxx/test/std')
92 files changed, 176 insertions, 191 deletions
diff --git a/libcxx/test/std/containers/unord/unord.multimap/scary.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/scary.pass.cpp index e619a7a5429..ad32ff713f5 100644 --- a/libcxx/test/std/containers/unord/unord.multimap/scary.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/scary.pass.cpp @@ -21,4 +21,5 @@ int main() typedef std::unordered_multimap<int, int> M2; M2::iterator i; M1::iterator j = i; + ((void)j); } diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp index 57e6b98c747..092f3dd9115 100644 --- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp @@ -47,7 +47,10 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); assert(c.size() == 5); typedef std::pair<C::const_iterator, C::const_iterator> Eq; @@ -93,7 +96,10 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); assert(c.size() == 5); typedef std::pair<C::const_iterator, C::const_iterator> Eq; diff --git a/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp index 117e8e68efa..362697b2c8e 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp @@ -45,7 +45,11 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); + assert(c.size() == 5); assert(c.count(1) == 2); assert(c.count(2) == 1); @@ -68,7 +72,10 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); assert(c.size() == 5); assert(c.count(1) == 2); assert(c.count(2) == 1); diff --git a/libcxx/test/std/containers/unord/unord.multiset/scary.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/scary.pass.cpp index dfd144bb317..aec6950c48f 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/scary.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/scary.pass.cpp @@ -21,4 +21,5 @@ int main() typedef std::unordered_multiset<int> M2; M2::iterator i; M1::iterator j = i; + ((void)j); } diff --git a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp index 71384f40283..9fbb773a463 100644 --- a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -29,23 +31,12 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, test_allocator<int> > C; - typedef int P; - P a[] = - { - P(1), - P(2), - P(3), - P(4), - P(1), - P(2) - }; C c0(7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), @@ -105,23 +96,12 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, min_allocator<int> > C; - typedef int P; - P a[] = - { - P(1), - P(2), - P(3), - P(4), - P(1), - P(2) - }; C c0(7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), @@ -181,7 +161,6 @@ int main() assert(c0.empty()); } -#endif #if _LIBCPP_DEBUG >= 1 { std::unordered_multiset<int> s1 = {1, 2, 3}; @@ -193,5 +172,4 @@ int main() assert(s2.size() == 2); } #endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp index c78eb138fd9..b584dbb2b30 100644 --- a/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp @@ -45,7 +45,11 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); + assert(c.size() == 3); assert(c.count(1) == 1); assert(c.count(3) == 1); @@ -66,7 +70,11 @@ int main() }; C c(a, a + sizeof(a)/sizeof(a[0])); C::const_iterator i = c.find(2); + C::const_iterator i_next = i; + ++i_next; C::iterator j = c.erase(i); + assert(j == i_next); + assert(c.size() == 3); assert(c.count(1) == 1); assert(c.count(3) == 1); diff --git a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp index c5200bf7511..0910bf15f8e 100644 --- a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -29,23 +31,12 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_set<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, test_allocator<int> > C; - typedef int P; - P a[] = - { - P(1), - P(2), - P(3), - P(4), - P(1), - P(2) - }; C c0(7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), @@ -105,23 +96,12 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, min_allocator<int> > C; - typedef int P; - P a[] = - { - P(1), - P(2), - P(3), - P(4), - P(1), - P(2) - }; C c0(7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), @@ -181,7 +161,6 @@ int main() assert(c0.empty()); } -#endif #if _LIBCPP_DEBUG >= 1 { std::unordered_set<int> s1 = {1, 2, 3}; @@ -193,5 +172,4 @@ int main() assert(s2.size() == 2); } #endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/libcxx/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp index 7efbafff83c..47fe52f7b1d 100644 --- a/libcxx/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp +++ b/libcxx/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp @@ -98,6 +98,8 @@ void checkThrows(any& a) } catch (...) { assert(false); } +#else + ((void)a); #endif } @@ -176,7 +178,6 @@ void test_cast_to_value() { Type::reset(); { any a((Type(42))); - any const& ca = a; assert(Type::count == 1); assert(Type::copied == 0); assert(Type::moved == 1); diff --git a/libcxx/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp b/libcxx/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp index e8d150f1e39..4b7ad735c7f 100644 --- a/libcxx/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp @@ -40,7 +40,6 @@ void doIOTest() { using namespace fs; using Ptr = const CharT*; using StrStream = std::basic_stringstream<CharT>; - const char* const InCStr = InStr; const Ptr E = OutStr; const path p((const char*)InStr); StrStream ss; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp index db10da092ef..c9b42b3596a 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp @@ -60,6 +60,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)t); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp index 1b56c709797..8c5241c71af 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp @@ -62,6 +62,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)t); ((void)ec); return true; #endif }; @@ -138,7 +139,6 @@ TEST_CASE(test_attributes_get_copied) const path file = env.create_file("file1", 42); const path dest = env.make_env_path("file2"); auto st = status(file); - perms default_perms = st.permissions(); perms new_perms = perms::owner_read; permissions(file, new_perms); std::error_code ec; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp index 6fae1119520..fe472980677 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp @@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)t); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp index e0473754cc8..85a3b6cb346 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp @@ -37,21 +37,6 @@ TEST_CASE(test_signatures) TEST_CASE(test_error_reporting) { - auto checkThrow = [](path const& f, path const& t, const std::error_code& ec) - { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - fs::create_directory_symlink(f, t); - return true; - } catch (filesystem_error const& err) { - return err.path1() == f - && err.code() == ec; - } -#else - return true; -#endif - }; - scoped_test_env env; const path file = env.create_file("file1", 42); const path file2 = env.create_file("file2", 55); diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp index 4a865fdee7e..7aefece46a4 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp @@ -36,21 +36,6 @@ TEST_CASE(test_signatures) TEST_CASE(test_error_reporting) { - auto checkThrow = [](path const& f, path const& t, const std::error_code& ec) - { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - fs::create_hard_link(f, t); - return true; - } catch (filesystem_error const& err) { - return err.path1() == f - && err.code() == ec; - } -#else - return true; -#endif - }; - scoped_test_env env; const path file = env.create_file("file1", 42); const path file2 = env.create_file("file2", 55); diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp index 35ba57f3ab4..d261d987a1e 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp @@ -37,21 +37,6 @@ TEST_CASE(test_signatures) TEST_CASE(test_error_reporting) { - auto checkThrow = [](path const& f, path const& t, const std::error_code& ec) - { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - fs::create_symlink(f, t); - return true; - } catch (filesystem_error const& err) { - return err.path1() == f - && err.code() == ec; - } -#else - return true; -#endif - }; - scoped_test_env env; const path file = env.create_file("file1", 42); const path file2 = env.create_file("file2", 55); diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp index 8c7c0a78ad5..4177392141e 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp @@ -53,6 +53,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)opts); ((void)ec); return true; #endif }; @@ -116,7 +117,7 @@ TEST_CASE(basic_permissions_test) permissions(TC.p, TC.set_perms, ec); TEST_CHECK(!ec); auto pp = status(TC.p).permissions(); - TEST_CHECK(status(TC.p).permissions() == TC.expected); + TEST_CHECK(pp == TC.expected); } } diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp index 00581cbe8bc..d69e95ce5d5 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp @@ -51,6 +51,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp index edb0c4fc76c..f7ce8a30e64 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp @@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp index aecfce7885e..b84c18c1da0 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp @@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp index c2ae854c0bf..e265c7af6b1 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp @@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)t); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp index 8a6aa09b14c..f7c2ee14e83 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp @@ -52,6 +52,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)s); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp index 865191520be..8f241810fc7 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp @@ -57,6 +57,7 @@ TEST_CASE(test_error_reporting) && err.code() == ec; } #else + ((void)f); ((void)ec); return true; #endif }; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp index bc44f1f6cbb..467e09d5d2b 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp @@ -43,7 +43,7 @@ template <typename T> struct MyHash { }; template <typename Iter1, typename Iter2> -void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) { std::experimental::boyer_moore_searcher<Iter2, MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>> s{b2, e2}; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp index 743ab92156b..ca8700bb44b 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp @@ -54,10 +54,12 @@ unsigned count_equal::count = 0; template <typename Iter1, typename Iter2> void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + count_equal::count = 0; std::experimental::boyer_moore_searcher<Iter2, MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; + assert(count_equal::count <= max_count); assert(result == std::experimental::search(b1, e1, s)); } @@ -78,7 +80,10 @@ test() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa * 2); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); int ic[] = {1}; @@ -93,6 +98,7 @@ test() const unsigned sh = sizeof(ih)/sizeof(ih[0]); int ii[] = {1, 1, 2}; do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); + } template <class Iter1, class Iter2> @@ -112,7 +118,10 @@ test2() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa * 2); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); char ic[] = {1}; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp index b27cabd76ab..5877b9cd97b 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp @@ -54,7 +54,7 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; count_equal::count = 0; assert(result == std::experimental::search(b1, e1, s)); -// assert(count_equal::count <= max_count); + assert(count_equal::count <= max_count); } template <class Iter1, class Iter2> @@ -74,7 +74,10 @@ test() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa * 2); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); int ic[] = {1}; @@ -108,7 +111,8 @@ test2() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa*2); char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); char ic[] = {1}; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp index 28a3f6d912f..abfab17d02c 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp @@ -42,7 +42,7 @@ template <typename T> struct MyHash { }; template <typename Iter1, typename Iter2> -void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) { std::experimental::boyer_moore_horspool_searcher<Iter2, MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>> s{b2, e2}; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp index 3a6647dbc7f..e6a36a4dac2 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp @@ -57,7 +57,9 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; + count_equal::count = 0; assert(result == std::experimental::search(b1, e1, s)); + assert(count_equal::count <= max_count); } template <class Iter1, class Iter2> @@ -77,7 +79,8 @@ test() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa*2); int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); int ic[] = {1}; @@ -111,7 +114,8 @@ test2() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa*2); char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); char ic[] = {1}; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp index 8c78b9de0b3..e621ad8cedc 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp @@ -53,7 +53,7 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; count_equal::count = 0; assert(result == std::experimental::search(b1, e1, s)); -// assert(count_equal::count <= max_count); + assert(count_equal::count <= max_count); } template <class Iter1, class Iter2> @@ -73,7 +73,8 @@ test() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa*2); int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); int ic[] = {1}; @@ -107,7 +108,8 @@ test2() do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); - do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + // FIXME: The max_count for this search should be 'sa' + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa*2); char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); char ic[] = {1}; diff --git a/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp index f0e0cc56661..a52b50b391c 100644 --- a/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp +++ b/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp @@ -44,7 +44,7 @@ constexpr bool test0(Input1 in1, Input2 in2, Output out) template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int dummy = 0) +constexpr bool do_test(int = 0) { using S1 = typename std::make_signed<Input1>::type; using S2 = typename std::make_signed<Input2>::type; diff --git a/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp index b1aa73400cf..e3c109f7447 100644 --- a/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp +++ b/libcxx/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp @@ -43,7 +43,7 @@ constexpr bool test0(Input1 in1, Input2 in2, Output out) template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int dummy = 0) +constexpr bool do_test(int = 0) { using S1 = typename std::make_signed<Input1>::type; using S2 = typename std::make_signed<Input2>::type; diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp index 6c2d71d9a23..c4640789657 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp @@ -55,7 +55,7 @@ public: class Z { public: - Z(int i) {TEST_THROW(6);} + Z(int) {TEST_THROW(6);} }; diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp index 07b1af96d10..f2d373c299b 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp @@ -60,7 +60,7 @@ public: Z(Z&&) {TEST_THROW(7);} friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} - friend void swap(Z& x, Z& y) {TEST_THROW(6);} + friend void swap(Z&, Z&) {TEST_THROW(6);} }; struct ConstSwappable { diff --git a/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp index 02d396758fb..4d643cb44b6 100644 --- a/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp @@ -59,7 +59,7 @@ public: Z(Z&&) {TEST_THROW(7);} friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} - friend void swap(Z& x, Z& y) {TEST_THROW(6);} + friend void swap(Z&, Z&) {TEST_THROW(6);} }; int main() diff --git a/libcxx/test/std/experimental/string.view/string.view.ops/substr.pass.cpp b/libcxx/test/std/experimental/string.view/string.view.ops/substr.pass.cpp index a651010d4b2..a3a1dbf418b 100644 --- a/libcxx/test/std/experimental/string.view/string.view.ops/substr.pass.cpp +++ b/libcxx/test/std/experimental/string.view/string.view.ops/substr.pass.cpp @@ -27,6 +27,7 @@ void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t po try { std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n); assert(false); + ((void)sv1); } catch (const std::out_of_range&) { return; } catch (...) { diff --git a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp index a5adf2d1f7f..0e46f91cfd1 100644 --- a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp +++ b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp @@ -25,4 +25,5 @@ int main() { P p1(2); P p2(std::move(p1)); + assert(*p2 == 2); } diff --git a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp index 8cf670a2540..488738d3207 100644 --- a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp +++ b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp @@ -24,7 +24,7 @@ template <> struct hash<X> { typedef X first_argument_type; - size_t operator()(const first_argument_type& x1) const + size_t operator()(const first_argument_type&) const { return 99; } diff --git a/libcxx/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/libcxx/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp index f19a8211cda..485da33cdec 100644 --- a/libcxx/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp +++ b/libcxx/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp @@ -18,4 +18,5 @@ int main() { std::ratio<100> x; + ((void)x); } diff --git a/libcxx/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp b/libcxx/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp index 51f9ab6bee1..7ac96d2502d 100644 --- a/libcxx/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp +++ b/libcxx/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp @@ -13,5 +13,6 @@ int main() { - std::experimental::erased_type e; + std::experimental::erased_type e; + ((void)e); } diff --git a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp index 004e7e9ea5f..77b4336538e 100644 --- a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp +++ b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp @@ -168,9 +168,6 @@ int main() catch (std::ios_base::failure&) { } -#else - ios1.copyfmt(ios2); -#endif assert(ios1.rdstate() == std::ios::eofbit); assert(ios1.rdbuf() == &sb1); assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); @@ -193,4 +190,5 @@ int main() assert(ios1.pword(1) == &d2); assert(ios1.tie() == (std::ostream*)2); assert(ios1.fill() == '2'); +#endif } diff --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp index 88624581df9..c1f3e55759a 100644 --- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp @@ -23,4 +23,5 @@ int main() std::ostream_iterator<int> i(outf); std::ostream_iterator<int> j = i; assert(outf.good()); + ((void)j); } diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp index 71130a8dbc6..c88e5b06e67 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp @@ -48,7 +48,7 @@ void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT std::free(p); } -void operator delete [] (void* p, std::align_val_t a) TEST_NOEXCEPT +void operator delete [] (void* p, std::align_val_t) TEST_NOEXCEPT { ++aligned_delete_called; std::free(p); diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp index 8f8dfe32e5e..131deb340d2 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp @@ -55,7 +55,7 @@ void* operator new[](std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad return DummyData; } -void operator delete[](void* p, std::align_val_t a) TEST_NOEXCEPT +void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT { assert(new_called == 1); --new_called; diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp index 6bfdd0591a2..a5d4df34a85 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp @@ -49,7 +49,7 @@ void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT std::free(p); } -void operator delete(void* p, std::align_val_t a) TEST_NOEXCEPT +void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT { ++aligned_delete_called; std::free(p); diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp index 0366cf8999c..df3e4c1560a 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp @@ -55,7 +55,7 @@ void* operator new(std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_a return DummyData; } -void operator delete(void* p, std::align_val_t a) TEST_NOEXCEPT +void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT { assert(new_called == 1); --new_called; diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp index 9d512bd9d13..2b4a686cf3e 100644 --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp @@ -27,7 +27,6 @@ int main() { -//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS typedef std::codecvt<char16_t, char, std::mbstate_t> F; static_assert((std::is_base_of<std::locale::facet, F>::value), ""); static_assert((std::is_base_of<std::codecvt_base, F>::value), ""); @@ -38,5 +37,5 @@ int main() assert(std::has_facet<F>(l)); const F& f = std::use_facet<F>(l); (void)F::id; -//#endif + ((void)f); } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp index 25f2b3d8df5..c76fea9af9f 100644 --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp @@ -27,7 +27,6 @@ int main() { -//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS typedef std::codecvt<char32_t, char, std::mbstate_t> F; static_assert((std::is_base_of<std::locale::facet, F>::value), ""); static_assert((std::is_base_of<std::codecvt_base, F>::value), ""); @@ -38,5 +37,5 @@ int main() assert(std::has_facet<F>(l)); const F& f = std::use_facet<F>(l); (void)F::id; -//#endif + ((void)f); } diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp index 6abf5cee328..aba76df0b9c 100644 --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp @@ -24,5 +24,6 @@ int main() { B b; std::mbstate_t s = b.state(); + ((void)s); } } diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp index 08dfa2558be..a7a816b37f9 100644 --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp @@ -22,4 +22,5 @@ int main() typedef std::wstring_convert<Codecvt> Myconv; Myconv myconv; std::mbstate_t s = myconv.state(); + ((void)s); } diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp index e09163a7057..03ed727cab8 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp @@ -35,7 +35,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp index 0fd9cf79bcb..a2c55390f2a 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp @@ -35,7 +35,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp index 58286904ae2..8eb72006a1a 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp index 157246947cf..0d039a159e4 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp @@ -36,7 +36,6 @@ test() void test_edges() { - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp index 0752ea59f55..36a2962218d 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp @@ -36,7 +36,6 @@ test() void test_edges() { - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp index aedeec8caac..74a3857e932 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp @@ -36,7 +36,6 @@ test() void test_edges() { - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp index e1b98ecd067..7ae59980b09 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp @@ -35,7 +35,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp index 20f2e71b140..491f3fac573 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp @@ -35,7 +35,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp index 041a7814d03..9f09ab5827d 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp @@ -36,7 +36,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp index 9a2276a8b75..8fa419c2179 100644 --- a/libcxx/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp +++ b/libcxx/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp @@ -35,7 +35,6 @@ test() void test_edges() { typedef std::complex<double> C; - const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/libcxx/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp b/libcxx/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp index 72275e01e1b..60b94ab5fc9 100644 --- a/libcxx/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp +++ b/libcxx/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp @@ -45,7 +45,6 @@ int main() // Test return value of assignment. { int a1[] = {0, 1, 2}; - int a2[] = {3, 4, 3}; std::valarray<int> v1(a1, 3); std::slice_array<int> s1 = v1[std::slice(1, 1, 1)]; std::slice_array<int> s2 = v1[std::slice(0, 1, 1)]; diff --git a/libcxx/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp b/libcxx/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp index 2fcdc973041..b2b55fdc3c4 100644 --- a/libcxx/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp +++ b/libcxx/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp @@ -41,7 +41,6 @@ int main() typedef int T; T a1[] = {1, 2, 3, 4, 5}; const unsigned N1 = sizeof(a1)/sizeof(a1[0]); - const unsigned N2 = 0; std::valarray<T> v1(a1, N1); std::valarray<T> v2; std::valarray<T> v1_save = v1; @@ -57,7 +56,6 @@ int main() { typedef int T; T a2[] = {6, 7, 8, 9, 10, 11, 12}; - const unsigned N1 = 0; const unsigned N2 = sizeof(a2)/sizeof(a2[0]); std::valarray<T> v1; std::valarray<T> v2(a2, N2); @@ -73,8 +71,6 @@ int main() } { typedef int T; - const unsigned N1 = 0; - const unsigned N2 = 0; std::valarray<T> v1; std::valarray<T> v2; std::valarray<T> v1_save = v1; diff --git a/libcxx/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp b/libcxx/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp index bd845ce6ef7..cb1807bf380 100644 --- a/libcxx/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp +++ b/libcxx/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp @@ -43,7 +43,6 @@ int main() typedef int T; T a1[] = {1, 2, 3, 4, 5}; const unsigned N1 = sizeof(a1)/sizeof(a1[0]); - const unsigned N2 = 0; std::valarray<T> v1(a1, N1); std::valarray<T> v2; std::valarray<T> v1_save = v1; @@ -59,7 +58,6 @@ int main() { typedef int T; T a2[] = {6, 7, 8, 9, 10, 11, 12}; - const unsigned N1 = 0; const unsigned N2 = sizeof(a2)/sizeof(a2[0]); std::valarray<T> v1; std::valarray<T> v2(a2, N2); @@ -75,8 +73,6 @@ int main() } { typedef int T; - const unsigned N1 = 0; - const unsigned N2 = 0; std::valarray<T> v1; std::valarray<T> v2; std::valarray<T> v1_save = v1; diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp index cde9db4ba12..af065b84d1b 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp @@ -44,7 +44,7 @@ constexpr bool test0(Input1 in1, Input2 in2, Output out) template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int dummy = 0) +constexpr bool do_test(int = 0) { using S1 = typename std::make_signed<Input1>::type; using S2 = typename std::make_signed<Input2>::type; diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp index 3eb7b7df3a4..cd03d99ebf1 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp @@ -43,7 +43,7 @@ constexpr bool test0(Input1 in1, Input2 in2, Output out) template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int dummy = 0) +constexpr bool do_test(int = 0) { using S1 = typename std::make_signed<Input1>::type; using S2 = typename std::make_signed<Input2>::type; diff --git a/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp b/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp index ff9285b28da..730576844a0 100644 --- a/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp @@ -49,6 +49,8 @@ void check_random_device_invalid(const std::string &token) { LIBCPP_ASSERT(false); } catch (const std::system_error&) { } +#else + ((void)token); #endif } diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp index 9e46c6e4360..de5b153e0d1 100644 --- a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp @@ -187,7 +187,7 @@ test4() kurtosis += d2 * d2; } var /= u.size(); - double dev = std::sqrt(var); + //double dev = std::sqrt(var); // In this case: // skew computes to 0./0. == nan // kurtosis computes to 0./0. == nan @@ -236,7 +236,7 @@ test5() kurtosis += d2 * d2; } var /= u.size(); - double dev = std::sqrt(var); +// double dev = std::sqrt(var); // In this case: // skew computes to 0./0. == nan // kurtosis computes to 0./0. == nan @@ -389,7 +389,7 @@ test9() kurtosis += d2 * d2; } var /= u.size(); - double dev = std::sqrt(var); +// double dev = std::sqrt(var); // In this case: // skew computes to 0./0. == nan // kurtosis computes to 0./0. == nan @@ -438,7 +438,7 @@ test10() kurtosis += d2 * d2; } var /= u.size(); - double dev = std::sqrt(var); +// double dev = std::sqrt(var); // In this case: // skew computes to 0./0. == nan // kurtosis computes to 0./0. == nan @@ -487,7 +487,7 @@ test11() kurtosis += d2 * d2; } var /= u.size(); - double dev = std::sqrt(var); +// double dev = std::sqrt(var); // In this case: // skew computes to 0./0. == nan // kurtosis computes to 0./0. == nan diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp index d9aaec38e38..17503364e03 100644 --- a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp @@ -193,8 +193,8 @@ test4() kurtosis -= 3; double x_mean = d.k() * (1 - d.p()) / d.p(); double x_var = x_mean / d.p(); - double x_skew = (2 - d.p()) / std::sqrt(d.k() * (1 - d.p())); - double x_kurtosis = 6. / d.k() + sqr(d.p()) / (d.k() * (1 - d.p())); +// double x_skew = (2 - d.p()) / std::sqrt(d.k() * (1 - d.p())); +// double x_kurtosis = 6. / d.k() + sqr(d.p()) / (d.k() * (1 - d.p())); assert(mean == x_mean); assert(var == x_var); } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp index a32b2ca0ae3..f866929795d 100644 --- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp @@ -617,11 +617,12 @@ int main() } std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); */ { + /* std::cmatch m; const char s[] = "m"; - /* assert(std::regex_match(s, m,*/ std::regex("[a[=M=]z]"/*, - std::regex_constants::awk*/);//)); -/* assert(m.size() == 1); + assert(std::regex_match(s, m, std::regex("[a[=M=]z]", + std::regex_constants::awk); + assert(m.size() == 1); assert(!m.prefix().matched); assert(m.prefix().first == s); assert(m.prefix().second == m[0].first); diff --git a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp index d6fc7696fca..fa4e675c78f 100644 --- a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp @@ -37,6 +37,8 @@ extern "C" void LLVMFuzzerTestOneInput(const char *data) } catch (std::regex_error &) {} } +#else + ((void)data); #endif } diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp index a4a0e294c26..a9eb6c961a3 100644 --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp @@ -18,7 +18,6 @@ int main() { - char s1[] = {1, 2, 3}; char s2[3] = {0}; assert(std::char_traits<char>::assign(s2, 3, char(5)) == s2); assert(s2[0] == char(5)); diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp index fc1ba6e8670..4b702fa8b40 100644 --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp @@ -19,7 +19,6 @@ int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - char16_t s1[] = {1, 2, 3}; char16_t s2[3] = {0}; assert(std::char_traits<char16_t>::assign(s2, 3, char16_t(5)) == s2); assert(s2[0] == char16_t(5)); diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp index 0c31ea7ae97..8e0ee2f6ff9 100644 --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp @@ -19,7 +19,6 @@ int main() { #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - char32_t s1[] = {1, 2, 3}; char32_t s2[3] = {0}; assert(std::char_traits<char32_t>::assign(s2, 3, char32_t(5)) == s2); assert(s2[0] == char32_t(5)); diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp index 2a00fe06e5a..acb50567172 100644 --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp @@ -18,7 +18,6 @@ int main() { - wchar_t s1[] = {1, 2, 3}; wchar_t s2[3] = {0}; assert(std::char_traits<wchar_t>::assign(s2, 3, wchar_t(5)) == s2); assert(s2[0] == wchar_t(5)); diff --git a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp index 5a5ff9df8fd..0f5ee05e9a0 100644 --- a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp @@ -72,7 +72,7 @@ std::unique_ptr<int> f4(std::unique_ptr<int>&& p) void f5(int j) { std::this_thread::sleep_for(ms(200)); - TEST_THROW(j); + TEST_THROW(j); ((void)j); } template <class Ret, class CheckLamdba, class ...Args> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp index aad6370b0f8..1cdeadf8495 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp @@ -22,7 +22,6 @@ void func(std::promise<int> p) { - const int i = 5; p.set_exception_at_thread_exit(std::make_exception_ptr(3)); } diff --git a/libcxx/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp b/libcxx/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp index 99f94b1eb38..07eeaaa46af 100644 --- a/libcxx/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp @@ -31,7 +31,7 @@ public: long operator()(long i, long j) const {return data_ + i + j;} }; -void func(std::packaged_task<double(int, char)> p) +void func(std::packaged_task<double(int, char)>) { } diff --git a/libcxx/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp b/libcxx/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp index 380f84cbb3c..a597c9d8304 100644 --- a/libcxx/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp @@ -60,6 +60,8 @@ void func2(std::packaged_task<double(int, char)> p) { assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied)); } +#else + ((void)p); #endif } @@ -74,6 +76,8 @@ void func3(std::packaged_task<double(int, char)> p) { assert(e.code() == make_error_code(std::future_errc::no_state)); } +#else + ((void)p); #endif } diff --git a/libcxx/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp b/libcxx/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp index b2d1ee0ddc0..6acf8c5a619 100644 --- a/libcxx/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp @@ -60,6 +60,8 @@ void func2(std::packaged_task<double(int, char)> p) { assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied)); } +#else + ((void)p); #endif } @@ -74,6 +76,8 @@ void func3(std::packaged_task<double(int, char)> p) { assert(e.code() == make_error_code(std::future_errc::no_state)); } +#else + ((void)p); #endif } diff --git a/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp b/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp index b2403079275..d7066f4bff4 100644 --- a/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp +++ b/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp @@ -45,7 +45,7 @@ int test2 = 0; int runs = 0; -void f() +void f(bool expect_result) { typedef std::chrono::system_clock Clock; typedef std::chrono::milliseconds milliseconds; @@ -54,7 +54,8 @@ void f() test1 = 1; cv.notify_one(); Clock::time_point t0 = Clock::now(); - bool r = cv.wait_for(lk, milliseconds(250), Pred(test2)); + bool result = cv.wait_for(lk, milliseconds(250), Pred(test2)); + assert(result == expect_result); Clock::time_point t1 = Clock::now(); if (runs == 0) { @@ -73,7 +74,7 @@ int main() { { L1 lk(m0); - std::thread t(f); + std::thread t(f, /*expect_result*/true); assert(test1 == 0); while (test1 == 0) cv.wait(lk); @@ -87,7 +88,7 @@ int main() test2 = 0; { L1 lk(m0); - std::thread t(f); + std::thread t(f, /*expect_result*/false); assert(test1 == 0); while (test1 == 0) cv.wait(lk); diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp index 64df0680b0b..5baaee533a6 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp @@ -28,7 +28,7 @@ int main() typedef std::try_to_lock_t T2; typedef std::adopt_lock_t T3; - T1 t1 = std::defer_lock; - T2 t2 = std::try_to_lock; - T3 t3 = std::adopt_lock; + T1 t1 = std::defer_lock; ((void)t1); + T2 t2 = std::try_to_lock; ((void)t2); + T3 t3 = std::adopt_lock; ((void)t3); } diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp index 6c31df593c0..e452ac98c49 100644 --- a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp +++ b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp @@ -58,7 +58,6 @@ int main() { G g; std::thread t0(g, 5, 5.5); - std::thread::id id = t0.get_id(); std::thread t1; t0 = std::move(t1); assert(false); diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp index 5cca7b0b66b..f9f38c85f0e 100644 --- a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp +++ b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp @@ -50,7 +50,8 @@ int main() std::thread::id id0 = t0.get_id(); std::thread t1; std::thread::id id1 = t1.get_id(); - assert(t0.get_id() != id1); + assert(t0.get_id() == id0); + assert(id0 != id1); assert(t1.get_id() == std::thread::id()); t0.join(); } diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp index eb31a208f5e..af081ecceef 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp +++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp @@ -103,6 +103,8 @@ void checkThrows(any& a) } catch (...) { assert(false); } +#else + ((void)a); #endif } diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp index a0c686de77b..180433109f2 100644 --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp @@ -29,7 +29,7 @@ struct DummyUnaryFunction struct BadUnaryFunction { template <typename S> - constexpr int operator()(S const & s) const + constexpr int operator()(S const &) const { // Trigger a compile error if this function is instantiated. // The constexpr is needed so that it is instantiated while checking diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp index 68986ac1aeb..c1f2899f153 100644 --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp @@ -56,8 +56,32 @@ constexpr decltype(std::placeholders::_9) cp9 = std::placeholders::_9; constexpr decltype(std::placeholders::_10) cp10 = std::placeholders::_10; #endif // TEST_STD_VER >= 11 +void use_placeholders_to_prevent_unused_warning() { + ((void)cp1); + ((void)cp2); + ((void)cp3); + ((void)cp4); + ((void)cp5); + ((void)cp6); + ((void)cp7); + ((void)cp8); + ((void)cp9); + ((void)cp10); + ((void)default1); + ((void)default2); + ((void)default3); + ((void)default4); + ((void)default5); + ((void)default6); + ((void)default7); + ((void)default8); + ((void)default9); + ((void)default10); +} + int main() { + use_placeholders_to_prevent_unused_warning(); test(std::placeholders::_1); test(std::placeholders::_2); test(std::placeholders::_3); diff --git a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp index f104385f08b..47a3e1cc596 100644 --- a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp @@ -138,26 +138,26 @@ inline constexpr CallType operator|(CallType LHS, CallType RHS) { struct ForwardingCallObject { template <class ...Args> - bool operator()(Args&&... args) & { + bool operator()(Args&&...) & { set_call<Args&&...>(CT_NonConst | CT_LValue); return true; } template <class ...Args> - bool operator()(Args&&... args) const & { + bool operator()(Args&&...) const & { set_call<Args&&...>(CT_Const | CT_LValue); return true; } // Don't allow the call operator to be invoked as an rvalue. template <class ...Args> - bool operator()(Args&&... args) && { + bool operator()(Args&&...) && { set_call<Args&&...>(CT_NonConst | CT_RValue); return true; } template <class ...Args> - bool operator()(Args&&... args) const && { + bool operator()(Args&&...) const && { set_call<Args&&...>(CT_Const | CT_RValue); return true; } @@ -526,7 +526,6 @@ void call_operator_forwarding_test() assert(Fn::check_call<int&&>(CT_Const | CT_RValue)); } { // test multi arg - int x = 42; const double y = 3.14; std::string s = "abc"; obj(42, std::move(y), s, std::string{"foo"}); diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp index a611b1a12f0..2949d6310c5 100644 --- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp +++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp @@ -24,4 +24,5 @@ int main() { std::default_delete<int[]> d1; std::default_delete<const int[]> d2 = d1; + ((void)d2); } diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp index 5720d3bd288..89b6fa24884 100644 --- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp +++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp @@ -38,7 +38,7 @@ source1() return std::unique_ptr<A[]>(new A[3]); } -void sink1(std::unique_ptr<A[]> p) +void sink1(std::unique_ptr<A[]>) { } @@ -48,7 +48,7 @@ source2() return std::unique_ptr<A[], Deleter<A[]> >(new A[3]); } -void sink2(std::unique_ptr<A[], Deleter<A[]> > p) +void sink2(std::unique_ptr<A[], Deleter<A[]> >) { } @@ -59,7 +59,7 @@ source3() return std::unique_ptr<A[], NCDeleter<A[]>&>(new A[3], d); } -void sink3(std::unique_ptr<A[], NCDeleter<A[]>&> p) +void sink3(std::unique_ptr<A[], NCDeleter<A[]>&>) { } diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp index 68111c0c13b..c4d4763a6f0 100644 --- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp @@ -87,6 +87,7 @@ void test_implicit() using T = ImplicitThrow; optional<T> t = 42; assert(false); + ((void)t); } catch (int) { } } diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp index ed3cafadbf0..a5b3d4415e3 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp @@ -91,6 +91,8 @@ int main() { } { std::tuple<A&&> t(std::forward_as_tuple(A{})); + ((void)t); std::tuple<ExplicitA&&> t2(std::forward_as_tuple(ExplicitA{})); + ((void)t2); } } diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp index 30e020e8f0b..dd9b832423a 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp @@ -47,30 +47,30 @@ struct ExplicitDerived : std::tuple<T> { int main() { { - std::tuple<Explicit> foo = Derived<int>{42}; + std::tuple<Explicit> foo = Derived<int>{42}; ((void)foo); assert(count == 1); - std::tuple<Explicit> bar(Derived<int>{42}); + std::tuple<Explicit> bar(Derived<int>{42}); ((void)bar); assert(count == 2); } count = 0; { - std::tuple<Implicit> foo = Derived<int>{42}; + std::tuple<Implicit> foo = Derived<int>{42}; ((void)foo); assert(count == 1); - std::tuple<Implicit> bar(Derived<int>{42}); + std::tuple<Implicit> bar(Derived<int>{42}); ((void)bar); assert(count == 2); } count = 0; { static_assert(!std::is_convertible< ExplicitDerived<int>, std::tuple<Explicit>>::value, ""); - std::tuple<Explicit> bar(ExplicitDerived<int>{42}); + std::tuple<Explicit> bar(ExplicitDerived<int>{42}); ((void)bar); assert(count == 1); } count = 0; { // FIXME: Libc++ incorrectly rejects this code. #ifndef _LIBCPP_VERSION - std::tuple<Implicit> foo = ExplicitDerived<int>{42}; + std::tuple<Implicit> foo = ExplicitDerived<int>{42}; ((void)foo); static_assert(std::is_convertible< ExplicitDerived<int>, std::tuple<Implicit>>::value, "correct STLs accept this"); @@ -80,7 +80,7 @@ int main() { "libc++ incorrectly rejects this"); #endif assert(count == 0); - std::tuple<Implicit> bar(ExplicitDerived<int>{42}); + std::tuple<Implicit> bar(ExplicitDerived<int>{42}); ((void)bar); assert(count == 1); } count = 0; diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp index 999a9ff1199..0da132fcfc2 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp @@ -82,6 +82,7 @@ int main() { // check that the literal '0' can implicitly initialize a stored pointer. std::tuple<int*> t = 0; + assert(std::get<0>(t) == nullptr); } { std::tuple<int> t(2); diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp index 0c93673532b..1cc13cf58ba 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp @@ -29,7 +29,7 @@ struct ConstructsWithTupleLeaf ConstructsWithTupleLeaf(ConstructsWithTupleLeaf &&) {} template <class T> - ConstructsWithTupleLeaf(T t) { + ConstructsWithTupleLeaf(T) { static_assert(!std::is_same<T, T>::value, "Constructor instantiated for type other than int"); } |