diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-22 19:52:49 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-22 19:52:49 +0000 |
commit | 7d38fcd81fa1bb68f7296b9cee6a9c4dcc383450 (patch) | |
tree | 2a921246e4b73298574625a91e0b3cbf99cee4b4 /lib/Sema/SemaExprObjC.cpp | |
parent | 78c5ce71333b502a58f9050f083e3f9476bb9fef (diff) |
Objective-C. Update my previous patch to not warn if
+initialize is called on 'super' in its implementation.
rdar://16628028
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index cbf41b5069..22c55a7726 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2232,8 +2232,9 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, diag::err_illegal_message_expr_incomplete_type)) return ExprError(); - // Warn about explicit call of +initialize on its own class. - if (Method && Method->getMethodFamily() == OMF_initialize) { + // Warn about explicit call of +initialize on its own class. But not on 'super'. + if (Method && Method->getMethodFamily() == OMF_initialize && + !SuperLoc.isValid()) { const ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext()); if (ID == Class) { |