diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp index b09079b5e8ba..6c5054fdca28 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp @@ -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(Error.Message.FileOffset)); return diag(Error.DiagnosticName, Loc, Error.Message.Message, static_cast(Error.DiagLevel)); }