[clang] [Clang] Add flags and lang option for C++2d (PR #203992)
A. Jiang via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 16 00:05:18 PDT 2026
================
@@ -228,7 +228,10 @@ static void addVisualCDefines(const LangOptions &Opts, MacroBuilder &Builder) {
Builder.defineMacro("_HAS_CHAR16_T_LANGUAGE_SUPPORT", Twine(1));
if (Opts.isCompatibleWithMSVC(LangOptions::MSVC2015)) {
- if (Opts.CPlusPlus26)
+ if (Opts.CPlusPlus29)
+ // TODO update to the proper value.
+ Builder.defineMacro("_MSVC_LANG", "202700L");
----------------
frederick-vs-ja wrote:
BTW, for Clang-cl, it seems that we should also have `-std:c++26preview` option and map `-std:c++latest` to `-std=c++2d`. But we should to discuss this with MSVC team first.
https://github.com/llvm/llvm-project/pull/203992
More information about the cfe-commits
mailing list