[clang-tools-extra] [clang-tidy] Fix assert failure in modernize-use-std-format when args are in macros (PR #176684)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 19 01:57:08 PST 2026
================
@@ -800,10 +800,11 @@ void FormatStringConverter::applyFixes(DiagnosticBuilder &Diag,
}
for (const auto &[ArgIndex, Replacement] : ArgFixes) {
- const SourceLocation AfterOtherSide =
- utils::lexer::findNextTokenSkippingComments(Args[ArgIndex]->getEndLoc(),
- SM, LangOpts)
- ->getLocation();
+ const auto NextToken = utils::lexer::findNextTokenSkippingComments(
+ Args[ArgIndex]->getEndLoc(), SM, LangOpts);
+ if (!NextToken)
+ continue;
----------------
zeyi2 wrote:
> We can probably land "easy" part of unchecked-optional-access that can prevent real crashes.
I think that PR is almost "finished", IMO after reverting the last commit and resolving conflicts it would be ready for merging? I will work on it later.
https://github.com/llvm/llvm-project/pull/176684
More information about the cfe-commits
mailing list