From: Jonathan Wakely Date: Tue, 15 Apr 2025 13:01:55 +0000 (+0100) Subject: libstdc++: Add test for not using reserved name 'ranges' before C++20 X-Git-Tag: releases/gcc-14.3.0~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d03428400552156abd0d639dfc8fe9bb00158cb;p=thirdparty%2Fgcc.git 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. --- 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