Resolve lint warning about converting unsigned to signed (NFC)

FileOffset is unsigned while getLocWithOffset() requires a signed value.
This commit is contained in:
Salman Javed 2021-12-23 09:31:45 +13:00
parent 7347c28def
commit 86618e37bd
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}