[clang-tools-extra] 0e1997e - [clangd] Fix test compile with GCC (name conflict)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 18:02:36 PDT 2020


Author: Sam McCall
Date: 2020-06-26T03:02:28+02:00
New Revision: 0e1997ed4ef74202a1bec6e7c18ba7a1df496896

URL: https://github.com/llvm/llvm-project/commit/0e1997ed4ef74202a1bec6e7c18ba7a1df496896
DIFF: https://github.com/llvm/llvm-project/commit/0e1997ed4ef74202a1bec6e7c18ba7a1df496896.diff

LOG: [clangd] Fix test compile with GCC (name conflict)

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
index db94e7b8ac56..e3b8215670c0 100644
--- a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
@@ -59,10 +59,10 @@ struct CapturedDiags {
       Out.Pos.character = D.getColumnNo(); // Zero-based - bug in SourceMgr?
       if (!D.getRanges().empty()) {
         const auto &R = D.getRanges().front();
-        Out.Range.emplace();
-        Out.Range->start.line = Out.Range->end.line = Out.Pos.line;
-        Out.Range->start.character = R.first;
-        Out.Range->end.character = R.second;
+        Out.Rng.emplace();
+        Out.Rng->start.line = Out.Rng->end.line = Out.Pos.line;
+        Out.Rng->start.character = R.first;
+        Out.Rng->end.character = R.second;
       }
     };
   }
@@ -70,7 +70,7 @@ struct CapturedDiags {
     std::string Message;
     llvm::SourceMgr::DiagKind Kind;
     Position Pos;
-    llvm::Optional<Range> Range;
+    llvm::Optional<Range> Rng;
 
     friend void PrintTo(const Diag &D, std::ostream *OS) {
       *OS << (D.Kind == llvm::SourceMgr::DK_Error ? "error: " : "warning: ")
@@ -83,7 +83,7 @@ struct CapturedDiags {
 MATCHER_P(DiagMessage, M, "") { return arg.Message == M; }
 MATCHER_P(DiagKind, K, "") { return arg.Kind == K; }
 MATCHER_P(DiagPos, P, "") { return arg.Pos == P; }
-MATCHER_P(DiagRange, R, "") { return arg.Range == R; }
+MATCHER_P(DiagRange, R, "") { return arg.Rng == R; }
 
 TEST(ParseYAML, SyntacticForms) {
   CapturedDiags Diags;


        


More information about the cfe-commits mailing list