https://bugs.llvm.org/show_bug.cgi?id=51462

            Bug ID: 51462
           Summary: Value of _MSVC_LANG should be larger than 202002L in
                    C++2b mode
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2b
          Assignee: unassignedclangb...@nondot.org
          Reporter: ens...@mailnesia.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Currently _MSVC_LANG is defined as 201705L both in C++20 mode (/std:c++20 for
clang-cl) and in C++2b mode (/std:c++latest for clang-cl). This prevents
library code from discovering whether C++2b features are enabled.

The relevant code is in
https://github.com/llvm/llvm-project/blob/1e11ccad837c2d0d848349e7bc8f5800e5d365fc/clang/lib/Basic/Targets/OSTargets.cpp#L183-L190
:

    if (Opts.isCompatibleWithMSVC(LangOptions::MSVC2015)) {
      if (Opts.CPlusPlus20)
        Builder.defineMacro("_MSVC_LANG", "201705L");
      else if (Opts.CPlusPlus17)
        Builder.defineMacro("_MSVC_LANG", "201703L");
      else if (Opts.CPlusPlus14)
        Builder.defineMacro("_MSVC_LANG", "201402L");
    }

For the reference, MSVC 2022 preview 3 (latest MSVC as of now) uses 202002L for
C++20 and 202004L for C++2b.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to