From c42966921a2897c2a2a52d60b3b029ba63858391 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 17 Aug 2016 14:39:05 +0100 Subject: [PATCH] Adjust testcases for C++17 compatibility * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Disable test for C++17. * testsuite/experimental/chrono/value.cc: Avoid ambiguities in C++17. * testsuite/experimental/ratio/value.cc: Likewise. * testsuite/ext/pb_ds/regression/hash_map_rand.cc: Disable test for C++17. * testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilities/special_functions/ 10_cyl_bessel_k/airy.cc: Adjust namespace of __detail::__airy for C++17 compatibility. From-SVN: r239534 --- libstdc++-v3/ChangeLog | 18 ++++++++++++++++++ .../headers/cmath/types_std_c++0x_neg.cc | 3 +-- .../testsuite/experimental/chrono/value.cc | 7 +++---- .../testsuite/experimental/ratio/value.cc | 18 ++++++++++++++---- .../ext/pb_ds/regression/hash_map_rand.cc | 2 ++ .../ext/pb_ds/regression/hash_set_rand.cc | 2 ++ .../pb_ds/regression/list_update_map_rand.cc | 2 ++ .../pb_ds/regression/list_update_set_rand.cc | 2 ++ .../pb_ds/regression/priority_queue_rand.cc | 2 ++ .../ext/pb_ds/regression/tree_map_rand.cc | 2 ++ .../ext/pb_ds/regression/tree_set_rand.cc | 2 ++ .../ext/pb_ds/regression/trie_map_rand.cc | 2 ++ .../ext/pb_ds/regression/trie_set_rand.cc | 2 ++ .../special_functions/10_cyl_bessel_k/airy.cc | 5 ++++- 14 files changed, 58 insertions(+), 11 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2016a95c5da..be50c0d703f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,23 @@ 2016-08-17 Jonathan Wakely + * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Disable + test for C++17. + * testsuite/experimental/chrono/value.cc: Avoid ambiguities in C++17. + * testsuite/experimental/ratio/value.cc: Likewise. + * testsuite/ext/pb_ds/regression/hash_map_rand.cc: Disable test for + C++17. + * testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise. + * testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/special_functions/ + 10_cyl_bessel_k/airy.cc: Adjust namespace of __detail::__airy for + C++17 compatibility. + * testsuite/24_iterators/headers/iterator/range_access.cc: Adjust expected signatures for C++14 compatibility. diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc index 8910c7e9a90..14be44755ff 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc @@ -1,5 +1,4 @@ -// { dg-options "-std=gnu++11" } -// { dg-do compile } +// { dg-do compile { target { ! c++1z } } } // Copyright (C) 2007-2016 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/experimental/chrono/value.cc b/libstdc++-v3/testsuite/experimental/chrono/value.cc index 80117fd54b5..64c16feaef0 100644 --- a/libstdc++-v3/testsuite/experimental/chrono/value.cc +++ b/libstdc++-v3/testsuite/experimental/chrono/value.cc @@ -1,5 +1,4 @@ -// { dg-options "-std=gnu++14" } -// { dg-do compile } +// { dg-do compile { target c++14 } } // Copyright (C) 2014-2016 Free Software Foundation, Inc. // @@ -20,8 +19,8 @@ #include -using namespace std::chrono; -using namespace std::chrono::experimental; +using std::chrono::treat_as_floating_point; +using std::chrono::experimental::treat_as_floating_point_v; // These tests are rather simple, the front-end tests already test // variable templates, and the library tests for the underlying diff --git a/libstdc++-v3/testsuite/experimental/ratio/value.cc b/libstdc++-v3/testsuite/experimental/ratio/value.cc index 4c8a7f0f287..17a732ba8c4 100644 --- a/libstdc++-v3/testsuite/experimental/ratio/value.cc +++ b/libstdc++-v3/testsuite/experimental/ratio/value.cc @@ -1,5 +1,4 @@ -// { dg-options "-std=gnu++14" } -// { dg-do compile } +// { dg-do compile { target c++14 } } // Copyright (C) 2014-2016 Free Software Foundation, Inc. // @@ -20,8 +19,19 @@ #include -using namespace std; -using namespace std::experimental; +using std::ratio; +using std::ratio_equal; +using std::ratio_not_equal; +using std::ratio_less; +using std::ratio_less_equal; +using std::ratio_greater; +using std::ratio_greater_equal; +using std::experimental::ratio_equal_v; +using std::experimental::ratio_not_equal_v; +using std::experimental::ratio_less_v; +using std::experimental::ratio_less_equal_v; +using std::experimental::ratio_greater_v; +using std::experimental::ratio_greater_equal_v; // These tests are rather simple, the front-end tests already test // variable templates, and the library tests for the underlying diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_map_rand.cc index f4c39e018cc..ce50a3022fa 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_map_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_set_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_set_rand.cc index 52ff7dcd195..f476efb87de 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_set_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_set_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_map_rand.cc index 0ffb103a782..b0606094203 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_map_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // -*- C++ -*- diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_set_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_set_rand.cc index ec85e1a728e..7ba175f5504 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_set_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_set_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // -*- C++ -*- diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc index 295827e477e..a94d37de491 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_map_rand.cc index 81f5de94f35..2a4f1749150 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_map_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_set_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_set_rand.cc index 0c829673048..46e718da94e 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_set_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_set_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_map_rand.cc index c3632581ceb..2286a8538d7 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_map_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_set_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_set_rand.cc index a9a27f7d0a1..52faa6e2403 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_set_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_set_rand.cc @@ -1,3 +1,5 @@ +// __gnu_pbds::test::basic_type has ambiguous string conversions in C++17 +// { dg-do run { target { ! c++1z } } } // { dg-require-time "" } // This can take long on simulators, timing out the test. // { dg-options "-DITERATIONS=5" { target simulator } } diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc index 24619d5e482..f3aa2ed5c1f 100644 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc @@ -27,8 +27,11 @@ void test01() { - bool test __attribute__((unused)) = true; double x, Ai, Bi, Aip, Bip; x = 1.0; +#if __cplusplus <= 201402L std::tr1::__detail::__airy(x, Ai, Bi, Aip, Bip); +#else + std::__detail::__airy(x, Ai, Bi, Aip, Bip); +#endif } -- 2.30.2