From 9c29aed6980dce42f2a071db09663c435ac21ad1 Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Wed, 4 Dec 2019 14:38:00 -0800 Subject: Bug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest mode Summary: The patch adds correct value of _MSVC_LANG to match with MSVC++ VS2019 /std:c++latest mode. Bugzilla - Bug 43965 https://bugs.llvm.org/show_bug.cgi?id=43965 The value for a MS specific macro differs from Microsoft starting with VS2019 in /std:c++latest mode. -bash-4.2$ cat msvclang.cpp _MSVC_LANG -bash-4.2$ cl /std:c++latest -E msvclang.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. /std:c++latest is provided as a preview of language features from the latest C++ working draft, and we're eager to hear about bugs and suggestions for improvements. However, note that these features are provided as-is without support, and subject to changes or removal as the working draft evolves. See https://go.microsoft.com/fwlink/?linkid=2045807 for details. msvclang.cpp 201705L -bash-4.2$ clang-cl /std:c++latest -E msvclang.cpp 201704L Reviewers: rnk Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D70996 --- clang/lib/Basic/Targets/OSTargets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Basic') diff --git a/clang/lib/Basic/Targets/OSTargets.cpp b/clang/lib/Basic/Targets/OSTargets.cpp index 72fdb0e7dde..d4ffffc64ba 100644 --- a/clang/lib/Basic/Targets/OSTargets.cpp +++ b/clang/lib/Basic/Targets/OSTargets.cpp @@ -180,7 +180,7 @@ static void addVisualCDefines(const LangOptions &Opts, MacroBuilder &Builder) { if (Opts.isCompatibleWithMSVC(LangOptions::MSVC2015)) { if (Opts.CPlusPlus2a) - Builder.defineMacro("_MSVC_LANG", "201704L"); + Builder.defineMacro("_MSVC_LANG", "201705L"); else if (Opts.CPlusPlus17) Builder.defineMacro("_MSVC_LANG", "201703L"); else if (Opts.CPlusPlus14) -- cgit v1.2.3