1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 08:51:52 +08:00

clang-tidy module: fix offset issue with last string concat operand

This commit is contained in:
Kyle Edwards
2022-12-03 13:56:56 -05:00
parent 3d019b4133
commit b1366e215e
4 changed files with 62 additions and 42 deletions

View File

@@ -156,7 +156,8 @@ void StringConcatenationUseCmstrcatCheck::issueCorrection(
ExprNode = *It;
StringRef LastToken = Lexer::getSourceText(
CharSourceRange::getTokenRange(ExprNode->getArg(1)->getSourceRange()),
CharSourceRange::getTokenRange(
ExprNode->getArg(1)->getSourceRange().getEnd()),
Result.Context->getSourceManager(), Result.Context->getLangOpts());
FixIts.push_back(FixItHint::CreateInsertion(
ExprNode->getEndLoc().getLocWithOffset(LastToken.str().size()), ")"));