[cfe-commits] r171777 - in /cfe/trunk: lib/AST/DeclObjC.cpp lib/Sema/SemaDeclObjC.cpp test/SemaObjC/forward-protocol-incomplete-impl-warn.m
Douglas Gregor
dgregor at apple.com
Mon Jan 7 11:38:11 PST 2013
On Jan 7, 2013, at 11:21 AM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> Author: fjahanian
> Date: Mon Jan 7 13:21:03 2013
> New Revision: 171777
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171777&view=rev
> Log:
> objective-C: when searching for declarations in protocol
> list of classes, etc., make sure to look into protocol
> definitions. // rdar://12958878
>
> Added:
> cfe/trunk/test/SemaObjC/forward-protocol-incomplete-impl-warn.m
> Modified:
> cfe/trunk/lib/AST/DeclObjC.cpp
> cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>
> Modified: cfe/trunk/lib/AST/DeclObjC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=171777&r1=171776&r2=171777&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/DeclObjC.cpp (original)
> +++ cfe/trunk/lib/AST/DeclObjC.cpp Mon Jan 7 13:21:03 2013
> @@ -1352,15 +1352,19 @@
> }
>
> void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM) const {
> - for (ObjCProtocolDecl::prop_iterator P = prop_begin(),
> - E = prop_end(); P != E; ++P) {
> + const ObjCProtocolDecl *PDecl = this;
> + if (!isThisDeclarationADefinition() && getDefinition())
> + PDecl = getDefinition();
How about simply
if (const ObjCProtocolDecl *PDecl = getDefinition()) {
// loop over properties in PDecl
}
?
- Doug
More information about the cfe-commits
mailing list