This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ObjC/ObjC++ - fixes for @dynamic


This patch (to be applied on top of my other two recent ObjC/ObjC++ patches) fixes a number
of issues with @dynamic.  With this patch --

 * @dynamic works for properties coming from protocols (not just for properties directly declared
in the current interface);

 * @dynamic works if you have @dynamic in a class, and @synthesize in a subclass (for the same @property);

 * @dynamic works in the case where the class is declared to conform to a @protocol which declares 
a method that matches a setter/getter for a @dynamic @property in the class.  Apple's llvm-gcc has a testcase 
for that (no warning should be generated for the missing method) and it now works in the same way with our 
compiler as well. :-)

I had to rework how @dynamic is implemented to get these to work, but it wasn't too bad.

6 new testcases are included.

Ok to commit to trunk ?

Thanks

In gcc/objc/:
2010-11-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_dynamic_declaration_for_property): Do not
        search for the @property declation only in the current context,
        but also in inherited properties.  Do not mark the original
        PROPERTY_DECL in the @interface or @protocol with
        PROPERTY_DYNAMIC.
        (check_methods): To check if a method is associated with a
        @dynamic property, search for the property in IMPL_PROPERTY_DECL.
        (check_accessible_methods): Same change.
        * objc-act.h: Updated comment.

In gcc/testsuite/:
2010-11-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dynamic-4.m: New.
        * objc.dg/property/dynamic-5.m: New.
        * objc.dg/property/dynamic-6.m: New.    
        * obj-c++.dg/property/dynamic-4.mm: New.
        * obj-c++.dg/property/dynamic-5.mm: New.
        * obj-c++.dg/property/dynamic-6.mm: New.

Attachment: patch-trunk1.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]