[clang-tools-extra] 6b3168f - [clangd] Fix windows buildbots for #import statements

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 01:56:44 PDT 2020


Author: Kadir Cetinkaya
Date: 2020-04-21T10:56:34+02:00
New Revision: 6b3168f8cdb46656330929877b0b4daab35d30de

URL: https://github.com/llvm/llvm-project/commit/6b3168f8cdb46656330929877b0b4daab35d30de
DIFF: https://github.com/llvm/llvm-project/commit/6b3168f8cdb46656330929877b0b4daab35d30de.diff

LOG: [clangd] Fix windows buildbots for #import statements

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/HeadersTests.cpp
    clang-tools-extra/clangd/unittests/PreambleTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/HeadersTests.cpp b/clang-tools-extra/clangd/unittests/HeadersTests.cpp
index cb760a3d6c35..7f87573d9a11 100644
--- a/clang-tools-extra/clangd/unittests/HeadersTests.cpp
+++ b/clang-tools-extra/clangd/unittests/HeadersTests.cpp
@@ -210,6 +210,8 @@ TEST_F(HeadersTest, IncludeDirective) {
 #include_next "foo.h"
 )cpp";
 
+  // ms-compatibility changes meaning of #import, make sure it is turned off.
+  CDB.ExtraClangFlags.push_back("-fno-ms-compatibility");
   EXPECT_THAT(collectIncludes().MainFileIncludes,
               UnorderedElementsAre(Directive(tok::pp_include),
                                    Directive(tok::pp_import),

diff  --git a/clang-tools-extra/clangd/unittests/PreambleTests.cpp b/clang-tools-extra/clangd/unittests/PreambleTests.cpp
index 2815ca0a46f1..6382285b63fc 100644
--- a/clang-tools-extra/clangd/unittests/PreambleTests.cpp
+++ b/clang-tools-extra/clangd/unittests/PreambleTests.cpp
@@ -61,6 +61,8 @@ TEST(PreamblePatchTest, IncludeParsing) {
         ^#include <b.h>)cpp",
   };
 
+  // ms-compatibility changes meaning of #import, make sure it is turned off.
+  CDB.ExtraClangFlags.push_back("-fno-ms-compatibility");
   const auto FileName = testPath("foo.cc");
   for (const auto Case : Cases) {
     Annotations Test(Case);
@@ -96,6 +98,8 @@ TEST(PreamblePatchTest, ContainsNewIncludes) {
   MockFSProvider FS;
   MockCompilationDatabase CDB;
   IgnoreDiagnostics Diags;
+  // ms-compatibility changes meaning of #import, make sure it is turned off.
+  CDB.ExtraClangFlags.push_back("-fno-ms-compatibility");
 
   const auto FileName = testPath("foo.cc");
   ParseInputs PI;


        


More information about the cfe-commits mailing list