]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: add a constexpr macro for C++26
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Tue, 25 Feb 2025 18:07:46 +0000 (18:07 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 25 Feb 2025 22:34:23 +0000 (22:34 +0000)
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 (_GLIBCXX26_CONSTEXPR): New macro.

Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
libstdc++-v3/include/bits/c++config

index 07f75ea66595051733a0c22f84a089a524541d60..6a73507d0748fdcb2fb950d6b45bb54435a78d4b 100644 (file)
 # 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