diff mbox

[2/2] Adjust testcases for C++17 compatibility

Message ID 20160817135223.GF20016@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Aug. 17, 2016, 1:52 p.m. UTC
Adding TR1 and LFTS components to namespace std makes some tests fail
due to ambiguous names. This resolves those problems so the tests pass
using C++17.

    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.

Tested powerpc64le-linux, committed to trunk.
diff mbox

Patch

commit 9e77fc9382dd99fb38e39bcd91b385e668c6b742
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Aug 17 00:29:39 2016 +0100

    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.

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 8910c7e..14be447 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 80117fd..64c16fea 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 <experimental/chrono>
 
-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 4c8a7f0..17a732b 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 <experimental/ratio>
 
-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 f4c39e0..ce50a30 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 52ff7dc..f476efb 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 0ffb103..b060609 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 ec85e1a..7ba175f 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 295827e..a94d37d 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 81f5de9..2a4f1749 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 0c82967..46e718d 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 c363258..2286a853 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 a9a27f7..52faa6e 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 24619d5..f3aa2ed 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
 }