[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 23 01:31:58 PDT 2025


================
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) {
   return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
 }
 
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+                                       bool IncludeComments) {
+  if (!Loc.isValid())
+    return SourceRange();
+  std::optional<Token> NextToken =
+      Lexer::findNextToken(Loc, SourceMgr, LangOpts, IncludeComments);
----------------
cor3ntin wrote:

Should we use findLocationAfterToken here instead?

https://github.com/llvm/llvm-project/pull/141148


More information about the cfe-commits mailing list