================ @@ -164,6 +165,24 @@ void UseRangesCheck::registerMatchers(MatchFinder *Finder) { static void removeFunctionArgs(DiagnosticBuilder &Diag, const CallExpr &Call, ArrayRef<unsigned> Indexes, const ASTContext &Ctx) { + const auto GetCommaLoc = [&](SourceLocation BeginLoc, + SourceLocation EndLoc) -> CharSourceRange { + const SourceLocation CommaLoc = + lexer::findNextAnyTokenKind(BeginLoc, Ctx.getSourceManager(), + Ctx.getLangOpts(), tok::comma, tok::comma); + + const std::optional<Token> NextTok = lexer::findNextTokenIncludingComments( + CommaLoc, Ctx.getSourceManager(), Ctx.getLangOpts()); + + if (!NextTok) { + return {}; + } ---------------- vbvictor wrote:
```suggestion if (!NextTok) return {}; ``` Don't use braces around single-statement if's as (LLVM coding guide) https://github.com/llvm/llvm-project/pull/118568 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits