From 0fe9eaaa083b6cc032cbd3ad1286b1dd73ccdf54 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 22 Apr 2020 07:21:01 +0100 Subject: [PATCH] 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. --- libstdc++-v3/ChangeLog | 14 ++++++++++++++ libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc | 6 ++++++ libstdc++-v3/testsuite/23_containers/deque/erasure.cc | 4 ++-- .../testsuite/23_containers/forward_list/erasure.cc | 4 ++-- libstdc++-v3/testsuite/23_containers/list/erasure.cc | 4 ++-- libstdc++-v3/testsuite/23_containers/map/erasure.cc | 4 ++-- libstdc++-v3/testsuite/23_containers/set/erasure.cc | 4 ++-- .../testsuite/23_containers/unordered_map/erasure.cc | 4 ++-- .../testsuite/23_containers/unordered_set/erasure.cc | 4 ++-- libstdc++-v3/testsuite/23_containers/vector/erasure.cc | 4 ++-- 10 files changed, 36 insertions(+), 16 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 55df9a3..2e1484f 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 6e475cf..f36562a 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 328e2fd..8bd0206 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 ce321cf..133dc3a 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 2b543d2..3620342 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 4575e19..1bd8481 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 48e70db..e5cc4a2 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 a5af7f0..d08510f 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 c129b1b..bc719d6 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 c3fb41f..5480687 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 -- 2.7.4