[clang-tools-extra] r366321 - [clangd] Force the required interpretation of #import on windows tests.

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 06:21:25 PDT 2019

Author: sammccall
Date: Wed Jul 17 06:21:25 2019
New Revision: 366321

URL: http://llvm.org/viewvc/llvm-project?rev=366321&view=rev
[clangd] Force the required interpretation of #import on windows tests.

Summary: NFC but should fix a bunch of tests.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64857


Modified: clang-tools-extra/trunk/clangd/unittests/TestTU.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/TestTU.cpp?rev=366321&r1=366320&r2=366321&view=diff
--- clang-tools-extra/trunk/clangd/unittests/TestTU.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/TestTU.cpp Wed Jul 17 06:21:25 2019
@@ -38,6 +38,10 @@ ParsedAST TestTU::build() const {
     Cmd.push_back(ImplicitHeaderGuard ? ImportThunk.c_str()
                                       : FullHeaderName.c_str());
+    // ms-compatibility changes the meaning of #import.
+    // The default is OS-dependent (on on windows), ensure it's off.
+    if (ImplicitHeaderGuard)
+      Cmd.push_back("-fno-ms-compatibility");
   Cmd.insert(Cmd.end(), ExtraArgs.begin(), ExtraArgs.end());
   // Put the file name at the end -- this allows the extra arg (-xc++) to

More information about the cfe-commits mailing list