Skip to content

Commit 86618e3

Browse files
Resolve lint warning about converting unsigned to signed (NFC)
FileOffset is unsigned while getLocWithOffset() requires a signed value.
1 parent 7347c28 commit 86618e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ DiagnosticBuilder ClangTidyContext::diag(const ClangTidyError &Error) {
193193
SM.getFileManager().getFile(Error.Message.FilePath);
194194
FileID ID = SM.getOrCreateFileID(*File, SrcMgr::C_User);
195195
SourceLocation FileStartLoc = SM.getLocForStartOfFile(ID);
196-
SourceLocation Loc = FileStartLoc.getLocWithOffset(Error.Message.FileOffset);
196+
SourceLocation Loc = FileStartLoc.getLocWithOffset(
197+
static_cast<SourceLocation::IntTy>(Error.Message.FileOffset));
197198
return diag(Error.DiagnosticName, Loc, Error.Message.Message,
198199
static_cast<DiagnosticIDs::Level>(Error.DiagLevel));
199200
}

0 commit comments

Comments
 (0)