[PATCH] libstdc++: Add some missing ranges feature-test macro tests
Jonathan Wakely
jwakely@redhat.com
Thu Aug 22 13:44:03 GMT 2024
On Thu, 22 Aug 2024 at 14:31, Patrick Palka <ppalka@redhat.com> wrote:
>
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk and
> perhaps 14?
OK for trunk and gcc-14.
We didn't backport the fix to move ranges::iota to <numeric>, so the
iota.cc test will need adjustment on the branch.
>
> -- >8 --
>
> libstdc++-v3/ChangeLog:
>
> * testsuite/25_algorithms/contains/1.cc: Verify value of
> __cpp_lib_ranges_contains.
> * testsuite/25_algorithms/find_last/1.cc: Verify value of
> __cpp_lib_ranges_find_last.
> * testsuite/26_numerics/iota/2.cc: Verify value of
> __cpp_lib_ranges_iota.
> ---
> libstdc++-v3/testsuite/25_algorithms/contains/1.cc | 4 ++++
> libstdc++-v3/testsuite/25_algorithms/find_last/1.cc | 4 ++++
> libstdc++-v3/testsuite/26_numerics/iota/2.cc | 4 ++++
> 3 files changed, 12 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/contains/1.cc b/libstdc++-v3/testsuite/25_algorithms/contains/1.cc
> index 7d3fa048ef6..b44c06032e8 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/contains/1.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/contains/1.cc
> @@ -4,6 +4,10 @@
> #include <testsuite_hooks.h>
> #include <testsuite_iterators.h>
>
> +#if __cpp_lib_ranges_contains != 202207L
> +# error "Feature-test macro __cpp_lib_ranges_contains has wrong value in <algorithm>"
> +#endif
> +
> namespace ranges = std::ranges;
>
> void
> diff --git a/libstdc++-v3/testsuite/25_algorithms/find_last/1.cc b/libstdc++-v3/testsuite/25_algorithms/find_last/1.cc
> index 911e22887d1..8a40bb1a6b3 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/find_last/1.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/find_last/1.cc
> @@ -4,6 +4,10 @@
> #include <testsuite_hooks.h>
> #include <testsuite_iterators.h>
>
> +#if __cpp_lib_ranges_find_last != 202207L
> +# error "Feature-test macro __cpp_lib_ranges_find_last has wrong value in <algorithm>"
> +#endif
> +
> namespace ranges = std::ranges;
>
> constexpr bool
> diff --git a/libstdc++-v3/testsuite/26_numerics/iota/2.cc b/libstdc++-v3/testsuite/26_numerics/iota/2.cc
> index 040c48d91ce..b14580b8be1 100644
> --- a/libstdc++-v3/testsuite/26_numerics/iota/2.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/iota/2.cc
> @@ -4,6 +4,10 @@
> #include <testsuite_hooks.h>
> #include <testsuite_iterators.h>
>
> +#if __cpp_lib_ranges_iota != 202202L
> +# error "Feature-test macro __cpp_lib_ranges_iota has wrong value in <numeric>"
> +#endif
> +
> namespace ranges = std::ranges;
>
> void
> --
> 2.46.0.288.g3a7362eb9f
>
More information about the Libstdc++
mailing list