Hi,

On 08/01/2025 13:06, Jonathan Wakely wrote:
I agree with using 202400L, for consistency with the actual defined
value, and because at a quick glance it's unclear whether 202303 is
the value for C++23 or not. You have to know that 202302 is the real
value to identify that this is "something later than C++23" whereas
202400 is more obvious.

Good point! New patch attached.

Thanks,
--
Giuseppe D'Angelo

From da28db92930e32cc6f799c731d51f65327a9ebda Mon Sep 17 00:00:00 2001
From: Giuseppe D'Angelo <giuseppe.dang...@kdab.com>
Date: Wed, 1 Jan 2025 12:12:29 +0100
Subject: [PATCH] libstdc++: add a constexpr macro for C++26

Following the precedent of _GLIBCXX20_CONSTEXPR.
It will be used to decorate some functions which have been made
constexpr in C++26 (for instance P2562R1, and maybe P3508R0, P3369R0,
...).

libstdc++-v3/ChangeLog:

	* include/bits/c++config: Added the
	_GLIBCXX26_CONSTEXPR macro.

Signed-off-by: Giuseppe D'Angelo <giuseppe.dang...@kdab.com>
---
 libstdc++-v3/include/bits/c++config | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index a5001d0a0b0..3370833a8f7 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -222,6 +222,14 @@
 # endif
 #endif
 
+#ifndef _GLIBCXX26_CONSTEXPR
+# if __cplusplus >= 202400L
+#  define _GLIBCXX26_CONSTEXPR constexpr
+# else
+#  define _GLIBCXX26_CONSTEXPR
+# endif
+#endif
+
 #ifndef _GLIBCXX17_INLINE
 # if __cplusplus >= 201703L
 #  define _GLIBCXX17_INLINE inline
-- 
2.34.1

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to