From: Johannes Doerfert Date: Mon, 21 Jan 2019 14:23:46 +0000 (+0000) Subject: [NFC] Fix comparison warning issues by MSVC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77ec61ab8d31cef256d2793a3b8756aaac861395;p=clang [NFC] Fix comparison warning issues by MSVC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351744 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c3726c226f..5e9f27001d 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -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;