This is an archive of the discontinued LLVM Phabricator instance.

[objc_direct] fix uniquing when re-declaring a readwrite-direct property
ClosedPublic

Authored by MadCoder on Dec 16 2019, 10:23 PM.

Details

Summary

ObjCMethodDecl::getCanonicalDecl() for re-declared readwrite properties,
only looks in the ObjCInterface for the declaration of the setter
method, which it won't find.

When the method is a property accessor, we must look in extensions for a
possible redeclaration.

Extend the CG test to cover this issue.

Radar-Id: rdar://problem/57991337

Diff Detail

Event Timeline

MadCoder created this revision.Dec 16 2019, 10:23 PM
arphaman accepted this revision.Dec 17 2019, 8:57 AM

LGTM, But we should also have a test in Sema that verifies it works, and also covers class properties in addition to the instance ones. I can add one when committing (@MadCoder still doesn't have commit access).

This revision is now accepted and ready to land.Dec 17 2019, 8:57 AM

I couldn't come up with a reasonable Sema-based test, so I'm going to commit this as it is.

This revision was automatically updated to reflect the committed changes.