[clang] [clang-cl] Support the /std:c++23 option (PR #232659)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 03:26:44 PDT 2026


================
@@ -7794,12 +7794,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                              .Case("c++14", "-std=c++14")
                              .Case("c++17", "-std=c++17")
                              .Case("c++20", "-std=c++20")
+                             .Case("c++23", "-std=c++23")
                              // If you add cases below for spellings that are
                              // not in LangStandards.def, update
                              // TransferableCommand::tryParseStdArg() in
                              // lib/Tooling/InterpolatingCompilationDatabase.cpp
                              // to match.
-                             // TODO add c++23, c++26, c++29 when MSVC supports
+                             // TODO add c++26, c++29 when MSVC supports
                              // it.
                              .Case("c++23preview", "-std=c++23")
----------------
zmodem wrote:

Would it actually provide much value to users? It's very easy to keep the old spelling around and not get in the way of people's builds.

https://discourse.llvm.org/t/clang-cl-adding-std-c-23preview/82553 did say they "may" remove the preview option in the future; https://devblogs.microsoft.com/cppblog/msvc-build-tools-version-14-52-release-candidate-now-available/ says they "will" do so.

It's also a question of timing. The MSVC release is just a preview so far. It seems odd for us to deprecate the option before it has shipped in their stable. On the other hand, the next Clang release will probably be after that. On the third hand lots of people use Clang from HEAD.

I guess I'm undecided, but leaning towards we can deprecate it later if we think it's important.

https://github.com/llvm/llvm-project/pull/232659


More information about the cfe-commits mailing list