[gcc r14-11628] libstdc++: Add test for not using reserved name 'ranges' before C++20
Jonathan Wakely
redi@gcc.gnu.org
Wed Apr 16 09:02:30 GMT 2025
https://gcc.gnu.org/g:3d03428400552156abd0d639dfc8fe9bb00158cb
commit r14-11628-g3d03428400552156abd0d639dfc8fe9bb00158cb
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Apr 15 14:01:55 2025 +0100
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:
---
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
More information about the Libstdc++-cvs
mailing list