diff options
author | Salman Javed <mail@salmanjaved.org> | 2021-12-23 09:31:45 +1300 |
---|---|---|
committer | Salman Javed <mail@salmanjaved.org> | 2021-12-23 09:46:14 +1300 |
commit | 86618e37bded924d0a7a06ef0818bb9b2311532d (patch) | |
tree | d7eef8319c7ff9ee37e9ba13a7d0ce558661ec1a | |
parent | 7347c28def5637d3b44c6980383437672f43fdf5 (diff) | |
download | llvm-86618e37bded924d0a7a06ef0818bb9b2311532d.zip llvm-86618e37bded924d0a7a06ef0818bb9b2311532d.tar.gz llvm-86618e37bded924d0a7a06ef0818bb9b2311532d.tar.bz2 |
Resolve lint warning about converting unsigned to signed (NFC)
FileOffset is unsigned while getLocWithOffset() requires a signed value.
-rw-r--r-- | clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp index b09079b..6c5054f 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<SourceLocation::IntTy>(Error.Message.FileOffset)); return diag(Error.DiagnosticName, Loc, Error.Message.Message, static_cast<DiagnosticIDs::Level>(Error.DiagLevel)); } |