diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/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(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; }