[clang-tools-extra] [clang-tidy] Fix assert failure in modernize-use-std-format when args are in macros (PR #176684)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 19 01:51:44 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;
----------------
vbvictor wrote:
Oh, here it is!
https://github.com/zeyi2/llvm-project/blob/80e42a7811c4fedc8a01a6e78b239f364d2032f2/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp#L803-L807
So this could have been prematurely fixed.
https://github.com/llvm/llvm-project/pull/176684
More information about the cfe-commits
mailing list