From fe91b9d6da99d346abbd1063b1456a30664b215b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 20 Aug 2019 16:28:11 +0000 Subject: win: Enable /Zc:twoPhase by default if targeting MSVC 2017 update 3 or newer MSVC 2017 update 3 (_MSC_VER 1911) enables /Zc:twoPhase by default, and so should clang-cl: https://docs.microsoft.com/en-us/cpp/build/reference/zc-twophase clang-cl takes the MSVC version it emulates from the -fmsc-version flag, or if that's not passed it tries to check what the installed version of MSVC is and uses that, and failing that it uses a default version that's currently 1911. So this changes the default if no -fmsc-version flag is passed and no installed MSVC is detected. (It also changes the default if -fmsc-version is passed or MSVC is detected, and either indicates _MSC_VER >= 1911.) As mentioned in the MSDN article, the Windows SDK header files in version 10.0.15063.0 (Creators Update or Redstone 2) and earlier versions do not work correctly with /Zc:twoPhase. If you need to use these old SDKs with a new clang-cl, explicitly pass /Zc:twoPhase- to get the old behavior. Fixes PR43032. Differential Revision: https://reviews.llvm.org/D66394 llvm-svn: 369402 --- clang/docs/ReleaseNotes.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/docs/ReleaseNotes.rst') diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index f3291137bca..0585438d751 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -90,6 +90,9 @@ Attribute Changes in Clang Windows Support --------------- +- clang-cl now defaults to ``/Zc:twoPhase`` if targeting MSVC2017 update 3 or + later (``_MSC_VER`` >= 1911). This matches MSVC's behavior. Explicitly pass + ``/Zc:twoPhase-`` to restore the old behavior. - ... C Language Changes in Clang -- cgit v1.2.3