r351744 - [NFC] Fix comparison warning issues by MSVC

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 21 06:23:47 PST 2019


Author: jdoerfert
Date: Mon Jan 21 06:23:46 2019
New Revision: 351744

URL: http://llvm.org/viewvc/llvm-project?rev=351744&view=rev
Log:
[NFC] Fix comparison warning issues by MSVC

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=351744&r1=351743&r2=351744&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Jan 21 06:23:46 2019
@@ -3560,7 +3560,9 @@ static void handleCallbackAttr(Sema &S,
 
   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;




More information about the cfe-commits mailing list