aboutsummaryrefslogtreecommitdiff
path: root/libcpp/init.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
committerIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
commitaa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch)
tree886212591b1c9d127eaaf234a4a2e22452ea384a /libcpp/init.cc
parent97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff)
parent3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff)
downloadgcc-devel/gccgo.zip
gcc-devel/gccgo.tar.gz
gcc-devel/gccgo.tar.bz2
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'libcpp/init.cc')
-rw-r--r--libcpp/init.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/libcpp/init.cc b/libcpp/init.cc
index c508f06..693feaa 100644
--- a/libcpp/init.cc
+++ b/libcpp/init.cc
@@ -127,6 +127,8 @@ static const struct lang_flags lang_defaults[] =
/* CXX20 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
/* GNUCXX23 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 },
/* CXX23 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 },
+ /* GNUCXX26 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 },
+ /* CXX26 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 },
/* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
@@ -561,11 +563,14 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
if (CPP_OPTION (pfile, cplusplus))
{
- /* C++23 is not yet a standard. For now, use an invalid
- * year/month, 202100L, which is larger than 202002L. */
- if (CPP_OPTION (pfile, lang) == CLK_CXX23
+ /* C++26 is not yet a standard. For now, use an invalid
+ year/month, 202400L, which is larger than 202302L. */
+ if (CPP_OPTION (pfile, lang) == CLK_CXX26
+ || CPP_OPTION (pfile, lang) == CLK_GNUCXX26)
+ _cpp_define_builtin (pfile, "__cplusplus 202400L");
+ else if (CPP_OPTION (pfile, lang) == CLK_CXX23
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX23)
- _cpp_define_builtin (pfile, "__cplusplus 202100L");
+ _cpp_define_builtin (pfile, "__cplusplus 202302L");
else if (CPP_OPTION (pfile, lang) == CLK_CXX20
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX20)
_cpp_define_builtin (pfile, "__cplusplus 202002L");