From 3d03428400552156abd0d639dfc8fe9bb00158cb Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 15 Apr 2025 14:01:55 +0100 Subject: [PATCH] libstdc++: Add test for not using reserved name 'ranges' before C++20 This is a test for a bug that was present on trunk, because 'ranges' is not a reserved name before C++20. libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc: Check ranges is not used as an identifier before C++20. --- libstdc++-v3/testsuite/17_intro/names.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index ab12641b14df..5acbdf38044d 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -140,6 +140,10 @@ #define try_emplace ( #endif +#if __cplusplus < 202002L +#define ranges ( +#endif + // These clash with newlib so don't use them. # define __lockable cannot be used as an identifier # define __null_sentinel cannot be used as an identifier -- 2.47.2