[llvm-bugs] [Bug 51462] New: Value of _MSVC_LANG should be larger than 202002L in C++2b mode
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Aug 12 13:53:10 PDT 2021
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: unassignedclangbugs at nondot.org
Reporter: ensadc at mailnesia.com
CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
llvm-bugs at lists.llvm.org, richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210812/613870dc/attachment.html>
More information about the llvm-bugs
mailing list