[clang-tools-extra] 86618e3 - Resolve lint warning about converting unsigned to signed (NFC)
Salman Javed via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 22 12:52:10 PST 2021
Author: Salman Javed
Date: 2021-12-23T09:46:14+13:00
New Revision: 86618e37bded924d0a7a06ef0818bb9b2311532d
URL: https://github.com/llvm/llvm-project/commit/86618e37bded924d0a7a06ef0818bb9b2311532d
DIFF: https://github.com/llvm/llvm-project/commit/86618e37bded924d0a7a06ef0818bb9b2311532d.diff
LOG: Resolve lint warning about converting unsigned to signed (NFC)
FileOffset is unsigned while getLocWithOffset() requires a signed value.
Added:
Modified:
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index b09079b5e8ba4..6c5054fdca28e 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));
}
More information about the cfe-commits
mailing list