diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2024-07-02 06:58:41 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2024-07-02 07:00:19 -0400 |
commit | b67d557bd3627a428d5041edec129587d6d3972c (patch) | |
tree | db5ebb77f528ae8553e472a1101d07db7649e2fc /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 6ad82fcc7d418e6e4cac9e0f82a35d8021f61ffa (diff) | |
download | llvm-b67d557bd3627a428d5041edec129587d6d3972c.zip llvm-b67d557bd3627a428d5041edec129587d6d3972c.tar.gz llvm-b67d557bd3627a428d5041edec129587d6d3972c.tar.bz2 |
[C2y] Add -std=c2y and -std=gnu2y
This adds a language standard mode for the latest C standard. While
WG14 is hoping for a three-year cycle, it is not clear that the next
revision of C will be in 2026 and so a flag was not created for c26
specifically.
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 55ec460..5e52555 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -448,7 +448,9 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, // value is, are implementation-defined. // (Removed in C++20.) if (!LangOpts.CPlusPlus) { - if (LangOpts.C23) + if (LangOpts.C2y) + Builder.defineMacro("__STDC_VERSION__", "202400L"); + else if (LangOpts.C23) Builder.defineMacro("__STDC_VERSION__", "202311L"); else if (LangOpts.C17) Builder.defineMacro("__STDC_VERSION__", "201710L"); |