We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eabda17 commit 4fd9989Copy full SHA for 4fd9989
clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
@@ -800,9 +800,11 @@ void FormatStringConverter::applyFixes(DiagnosticBuilder &Diag,
800
}
801
802
for (const auto &[ArgIndex, Replacement] : ArgFixes) {
803
- const SourceLocation AfterOtherSide =
804
- Lexer::findNextToken(Args[ArgIndex]->getEndLoc(), SM, LangOpts)
805
- ->getLocation();
+ const auto NextToken =
+ Lexer::findNextToken(Args[ArgIndex]->getEndLoc(), SM, LangOpts);
+ if (!NextToken)
806
+ continue;
807
+ const SourceLocation AfterOtherSide = NextToken->getLocation();
808
809
Diag << FixItHint::CreateInsertion(Args[ArgIndex]->getBeginLoc(),
810
Replacement, true)
0 commit comments