]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add test for not using reserved name 'ranges' before C++20
authorJonathan Wakely <jwakely@redhat.com>
Tue, 15 Apr 2025 13:01:55 +0000 (14:01 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 16 Apr 2025 08:39:24 +0000 (09:39 +0100)
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

index ab12641b14dfd49a165858a2a94676244e6cc74b..5acbdf38044d86526be4b7bcd9e0e66b1431d564 100644 (file)
 #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