From: Jonathan Wakely Date: Wed, 22 Apr 2020 06:21:01 +0000 (+0100) Subject: libstdc++: Improve tests for __cpp_lib_erase_if macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fe9eaaa083b6cc032cbd3ad1286b1dd73ccdf54;p=gcc.git libstdc++: Improve tests for __cpp_lib_erase_if macro * testsuite/21_strings/basic_string/erasure.cc: Check for updated value of __cpp_lib_erase_if. * testsuite/23_containers/deque/erasure.cc: Likewise. * testsuite/23_containers/forward_list/erasure.cc: Likewise. * testsuite/23_containers/list/erasure.cc: Likewise. * testsuite/23_containers/map/erasure.cc: Likewise. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/23_containers/vector/erasure.cc: Likewise. --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 55df9a31244..2e1484fefb5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2020-04-22 Jonathan Wakely + + * testsuite/21_strings/basic_string/erasure.cc: Check for + __cpp_lib_erase_if macro. + * testsuite/23_containers/deque/erasure.cc: Add header name to #error + messages. + * testsuite/23_containers/forward_list/erasure.cc: Likewise. + * testsuite/23_containers/list/erasure.cc: Likewise. + * testsuite/23_containers/map/erasure.cc: Likewise. + * testsuite/23_containers/set/erasure.cc: Likewise. + * testsuite/23_containers/unordered_map/erasure.cc: Likewise. + * testsuite/23_containers/unordered_set/erasure.cc: Likewise. + * testsuite/23_containers/vector/erasure.cc: Likewise. + 2020-04-21 Jonathan Wakely * include/bits/stl_iterator.h (__normal_iterator): Use synth-three-way diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc b/libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc index 6e475cf40bc..f36562a3f19 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc @@ -21,6 +21,12 @@ #include #include +#ifndef __cpp_lib_erase_if +# error "Feature-test macro for erase_if missing in " +#elif __cpp_lib_erase_if < 202002 +# error "Feature-test macro for erase_if has wrong value in " +#endif + void test01() { diff --git a/libstdc++-v3/testsuite/23_containers/deque/erasure.cc b/libstdc++-v3/testsuite/23_containers/deque/erasure.cc index 328e2fdbefa..8bd0206c890 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif void diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc b/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc index ce321cf0c59..133dc3a699b 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif void diff --git a/libstdc++-v3/testsuite/23_containers/list/erasure.cc b/libstdc++-v3/testsuite/23_containers/list/erasure.cc index 2b543d2f321..3620342ba9a 100644 --- a/libstdc++-v3/testsuite/23_containers/list/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/list/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif void diff --git a/libstdc++-v3/testsuite/23_containers/map/erasure.cc b/libstdc++-v3/testsuite/23_containers/map/erasure.cc index 4575e191267..1bd84813a97 100644 --- a/libstdc++-v3/testsuite/23_containers/map/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/map/erasure.cc @@ -23,9 +23,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif auto is_odd_pair = [](const std::pair& p) diff --git a/libstdc++-v3/testsuite/23_containers/set/erasure.cc b/libstdc++-v3/testsuite/23_containers/set/erasure.cc index 48e70db814f..e5cc4a2c949 100644 --- a/libstdc++-v3/testsuite/23_containers/set/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/set/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif auto is_odd = [](const int i) { return i % 2 != 0; }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc index a5af7f02d4f..d08510f789c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc @@ -23,9 +23,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif auto is_odd_pair = [](const std::pair& p) diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/erasure.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/erasure.cc index c129b1bbfd3..bc719d6a1dd 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif void diff --git a/libstdc++-v3/testsuite/23_containers/vector/erasure.cc b/libstdc++-v3/testsuite/23_containers/vector/erasure.cc index c3fb41f576b..548068741d2 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/erasure.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/erasure.cc @@ -22,9 +22,9 @@ #include #ifndef __cpp_lib_erase_if -# error "Feature-test macro for erase_if missing" +# error "Feature-test macro for erase_if missing in " #elif __cpp_lib_erase_if < 202002 -# error "Feature-test macro for erase_if has wrong value" +# error "Feature-test macro for erase_if has wrong value in " #endif void