[clang] 0636309 - Fix MSVC "signed/unsigned mismatch" warning. NFC.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 15 02:41:25 PST 2024


Author: Simon Pilgrim
Date: 2024-02-15T10:41:09Z
New Revision: 0636309051f3b1a2b87047770bb3f7df1f3e27c3

URL: https://github.com/llvm/llvm-project/commit/0636309051f3b1a2b87047770bb3f7df1f3e27c3
DIFF: https://github.com/llvm/llvm-project/commit/0636309051f3b1a2b87047770bb3f7df1f3e27c3.diff

LOG: Fix MSVC "signed/unsigned mismatch" warning. NFC.

Added: 
    

Modified: 
    clang/lib/AST/Interp/Function.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Function.h b/clang/lib/AST/Interp/Function.h
index 6500e0126c226f..b19d64f9371e3c 100644
--- a/clang/lib/AST/Interp/Function.h
+++ b/clang/lib/AST/Interp/Function.h
@@ -186,7 +186,7 @@ class Function final {
   /// Returns the number of parameter this function takes when it's called,
   /// i.e excluding the instance pointer and the RVO pointer.
   unsigned getNumWrittenParams() const {
-    assert(getNumParams() >= (hasThisPointer() + hasRVO()));
+    assert(getNumParams() >= (unsigned)(hasThisPointer() + hasRVO()));
     return getNumParams() - hasThisPointer() - hasRVO();
   }
   unsigned getWrittenArgSize() const {


        


More information about the cfe-commits mailing list