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


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to