summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index c3726c226f6..5e9f27001d6 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud