jvikstrom updated this revision to Diff 214110.
jvikstrom marked an inline comment as done.
jvikstrom added a comment.

Changed to do an isa<CXXConversion> check instead of checking if MemberLoc is 
invalid.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65928/new/

https://reviews.llvm.org/D65928

Files:
  clang-tools-extra/clangd/SemanticHighlighting.cpp


Index: clang-tools-extra/clangd/SemanticHighlighting.cpp
===================================================================
--- clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -52,6 +52,11 @@
       // When calling the destructor manually like: AAA::~A(); The ~ is a
       // MemberExpr. Other methods should still be highlighted though.
       return true;
+    if (isa<CXXConversionDecl>(MD))
+      // If the member is a conversion operator the loc will be invalid. This
+      // causes the addToken function to emit a lot of error logs about trying
+      // to add a token with an invalid range.
+      return true;
     addToken(ME->getMemberLoc(), MD);
     return true;
   }


Index: clang-tools-extra/clangd/SemanticHighlighting.cpp
===================================================================
--- clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -52,6 +52,11 @@
       // When calling the destructor manually like: AAA::~A(); The ~ is a
       // MemberExpr. Other methods should still be highlighted though.
       return true;
+    if (isa<CXXConversionDecl>(MD))
+      // If the member is a conversion operator the loc will be invalid. This
+      // causes the addToken function to emit a lot of error logs about trying
+      // to add a token with an invalid range.
+      return true;
     addToken(ME->getMemberLoc(), MD);
     return true;
   }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to