]> granicus.if.org Git - clang/commitdiff
[NFC] Fix comparison warning issues by MSVC
authorJohannes Doerfert <jdoerfert@anl.gov>
Mon, 21 Jan 2019 14:23:46 +0000 (14:23 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Mon, 21 Jan 2019 14:23:46 +0000 (14:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351744 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp

index c3726c226f659d6ba490802ba8ed5b1ca3358f7c..5e9f27001d67760669bdefb654db9d9161a9c234 100644 (file)
@@ -3560,7 +3560,9 @@ static void handleCallbackAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
 
   int CalleeIdx = EncodingIndices.front();
   // Check if the callee index is proper, thus not "this" and not "unknown".
-  if (CalleeIdx < HasImplicitThisParam) {
+  // This means the "CalleeIdx" has to be non-negative if "HasImplicitThisParam"
+  // is false and positive if "HasImplicitThisParam" is true.
+  if (CalleeIdx < (int)HasImplicitThisParam) {
     S.Diag(AL.getLoc(), diag::err_callback_attribute_invalid_callee)
         << AL.getRange();
     return;