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++: fixed pre/post increment/decrement operators with Objective-C 2.0 dotsyntax


This patch fixes using pre/post increment/decrement operators with Objective-C 2.0
dot-syntax.  For example,

 object.property++;

would not work before this patch, but now it does :-)

The patch includes testcases, and I updated an old testcase where the object.property++ syntax
was commented out as it wasn't working yet.

Ok to commit to trunk ?

Thanks

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

        * c-typeck.c (build_unary_op): Use
        objc_build_incr_expr_for_property_ref to build the pre/post
        increment/decrement of an Objective-C property ref, and skip the
        lvalue_or_else check in that case.

In gcc/c-family/:
2010-11-14  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_build_incr_expr_for_property_ref): New.
        * stub-objc.c (objc_build_incr_expr_for_property_ref): New.

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

        * typeck.c (cp_build_unary_op): Use
        objc_build_incr_expr_for_property_ref to build the pre/post
        increment/decrement of an Objective-C property ref.

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

        * objc-act.c (objc_build_incr_expr_for_property_ref): New.
        (objc_create_temporary_var): Moved it towards the beginning of the
        file so that objc_build_incr_expr_for_property_ref can use it.

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

        * objc.dg/property/dotsyntax-16.m: New.
        * objc.dg/property/dotsyntax-17.m: New.
        * obj-c++.dg/property/dotsyntax-16.mm: New.
        * obj-c++.dg/property/dotsyntax-17.mm: New.
        * objc.dg/property/at-property-10.m: Uncommented using 'x++'
        syntax with properties, which now works.
        * obj-c++.dg/property/at-property-10.mm: Same change.

Attachment: patch.txt
Description: Text document


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