diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-03 21:11:43 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-03 21:11:43 +0000 |
| commit | fcded9b93a96e9a88405325b30caa4cd11120aee (patch) | |
| tree | c06abf22140d0af2b7fe042a8be53f012ae1bb3e /clang/lib/AST | |
| parent | 22bfa2c28bdbca09949ba4cf8670c310d3e42c71 (diff) | |
| download | bcm5719-llvm-fcded9b93a96e9a88405325b30caa4cd11120aee.tar.gz bcm5719-llvm-fcded9b93a96e9a88405325b30caa4cd11120aee.zip | |
[objc] Emit warnings when the implementation of a designated initializer calls on
super an initializer that is not a designated one or any initializer on self.
llvm-svn: 196317
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index cb58ad482e1..b392e2f6619 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -655,12 +655,15 @@ bool ObjCMethodDecl::isThisDeclarationADesignatedInitializer() const { hasAttr<ObjCDesignatedInitializerAttr>(); } -bool ObjCMethodDecl::isDesignatedInitializerForTheInterface() const { +bool ObjCMethodDecl::isDesignatedInitializerForTheInterface( + const ObjCMethodDecl **InitMethod) const { + if (getMethodFamily() != OMF_init) + return false; const DeclContext *DC = getDeclContext(); if (isa<ObjCProtocolDecl>(DC)) return false; if (const ObjCInterfaceDecl *ID = getClassInterface()) - return ID->isDesignatedInitializer(getSelector()); + return ID->isDesignatedInitializer(getSelector(), InitMethod); return false; } |

