Skip to content

Commit

Permalink
Resolve lint warning about converting unsigned to signed (NFC)
Browse files Browse the repository at this point in the history
FileOffset is unsigned while getLocWithOffset() requires a signed value.
  • Loading branch information
salman-javed-nz committed Dec 22, 2021
1 parent 7347c28 commit 86618e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ DiagnosticBuilder ClangTidyContext::diag(const ClangTidyError &Error) {
SM.getFileManager().getFile(Error.Message.FilePath);
FileID ID = SM.getOrCreateFileID(*File, SrcMgr::C_User);
SourceLocation FileStartLoc = SM.getLocForStartOfFile(ID);
SourceLocation Loc = FileStartLoc.getLocWithOffset(Error.Message.FileOffset);
SourceLocation Loc = FileStartLoc.getLocWithOffset(
static_cast<SourceLocation::IntTy>(Error.Message.FileOffset));
return diag(Error.DiagnosticName, Loc, Error.Message.Message,
static_cast<DiagnosticIDs::Level>(Error.DiagLevel));
}
Expand Down

0 comments on commit 86618e3

Please sign in to comment.