diff options
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 17850bb2d7..58e28a9404 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1780,6 +1780,14 @@ ExprResult Sema::ActOnSuperMessage(Scope *S, if (Method->isInstanceMethod()) { if (Sel.getMethodFamily() == OMF_dealloc) getCurFunction()->ObjCShouldCallSuperDealloc = false; + else if (const ObjCMethodDecl *IMD = + Class->lookupMethod(Method->getSelector(), + Method->isInstanceMethod())) + // Must check for name of message since the method could + // be another method with objc_requires_super attribute set. + if (IMD->hasAttr<ObjCRequiresSuperAttr>() && + Sel == IMD->getSelector()) + getCurFunction()->ObjCShouldCallSuperDealloc = false; if (Sel.getMethodFamily() == OMF_finalize) getCurFunction()->ObjCShouldCallSuperFinalize = false; |