diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-14 20:35:00 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-14 20:35:00 +0000 |
commit | 65477082fee4881b636d1abc8a56ef5ed1fb7a52 (patch) | |
tree | 29d649335f7f94e849f0330fdf87f37a00f02573 /lib/Sema/SemaDeclObjC.cpp | |
parent | 6bf7eacf932cf4f0e2531eaff6c31cc5f39b659a (diff) |
Objective-C. Turn off designated initialization warnings on
'init' methods which are unavailable. Subclasses of NSObject
have to implement such methods as a common pattern to prevent
user's own implementation. // rdar://16305460
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 3198b01949..ca4d20c099 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -392,11 +392,14 @@ void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) { if (MDecl->getMethodFamily() == OMF_init) { if (MDecl->isDesignatedInitializerForTheInterface()) { getCurFunction()->ObjCIsDesignatedInit = true; - getCurFunction()->ObjCWarnForNoDesignatedInitChain = + // Don't issue this warning for unavaialable inits. + if (!MDecl->isUnavailable()) + getCurFunction()->ObjCWarnForNoDesignatedInitChain = IC->getSuperClass() != 0; } else if (IC->hasDesignatedInitializers()) { getCurFunction()->ObjCIsSecondaryInit = true; - getCurFunction()->ObjCWarnForNoInitDelegation = true; + // Don't issue this warning for unavaialable inits. + getCurFunction()->ObjCWarnForNoInitDelegation = !MDecl->isUnavailable(); } } |