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]

Re: ObjC/ObjC++: bug fixes for @catch


Iain,

thanks for your feedback.

>> (sadly, as it is
>> well-known (PR objc++/23616), ObjC exceptions don't actually work in  
>> ObjC++, so I had to disable the
>> ObjC++ execution one as fixing that is not part of this patch.  I  
>> don't think I'll work on that for 4.6,
>> it's too late)
>
> ... but they should work for NeXT runtime ;-)

Sure ... so what do you suggest ?  We don't want to introduce any new failures 
that simply duplicate existing ones.  That just confuses people that try to track
PRs and regressions. ;-)

Ideally exceptions-2.mm should be compiled only with the GNU runtime, and 
compiled + executed with the NeXT one, but I don't think there is an easy way 
to do this, hence I marked it just for compilation.  Do you know any way that 
doesn't require duplicating the testcase ?  Anyway, that can be done in a separate 
patch.


>>        * objc.dg/exceptions-1.m: New.
>>        * objc.dg/exceptions-2.m: New.
>>        * objc.dg/exceptions-3.m: New.
>>        * objc.dg/exceptions-4.m: New.
>>        * objc.dg/exceptions-5.m: New.
>>        * obj-c++.dg/exceptions-1.mm: New.
>>        * obj-c++.dg/exceptions-2.mm: New.
>>        * obj-c++.dg/exceptions-3.mm: New.
>>        * obj-c++.dg/exceptions-4.mm: New.
>>        * obj-c++.dg/exceptions-5.mm: New.
>
> I think we can honestly forecast needing enough exception tests to  
> warrant starting a new directory for them --
> ... also we should identify suitable candidates for torture testing -  
> which is especially weak for Obj-C++
>
> obj*.dg/exceptions/
> obj*.dg/torture/exceptions/
>
>  the .exp scripts in an existing parallel dir should serve as a  
> template
> (or let me know off-list and I'll do this and send you an increment to  
> your patch)

Ok - sounds good - in attach a revised patch:

 * I moved the new testcases into objc.dg/exceptions and obj-c++.dg/exceptions subdirectories

 * I changed the top-level dg.exp file to run the testcases in the subdirectories
as well as the testcases in the top-level (I don't want to duplicate the .exp files
in each subdirectory unless there is a reason to do so)
 
 * I renamed a variable I had added to the parser code to something better (open_paren_seen
renamed to seen_open_paren).

There are no good candidates for torture test in this patch, which is a "parser"
patch.  Even the execution test really only tests that the parser is passing the
right information to objc-act.c.  So I think the patch is now ready :-)

Ok to commit ?

Thanks

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

        * objc-act.c (objc_eh_runtime_type): Avoid ICE if error_mark_node
        is passed as argument.
        (objc_begin_catch_clause): Added code to deal with an
        error_mark_node or NULL_TREE argument.  Improved checks for
        invalid arguments.  Added code to traverse typedefs.

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

        * objc.dg/dg.exp: Run the tests in objc.dg/exceptions as well.
        * objc.dg/exceptions/exceptions-1.m: New.
        * objc.dg/exceptions/exceptions-2.m: New.
        * objc.dg/exceptions/exceptions-3.m: New.
        * objc.dg/exceptions/exceptions-4.m: New.
        * objc.dg/exceptions/exceptions-5.m: New.
        * obj-c++.dg/dg.exp: Run the tests in obj-c++.dg/exceptions as well.
        * obj-c++.dg/exceptions/exceptions-1.mm: New.
        * obj-c++.dg/exceptions/exceptions-2.mm: New.
        * obj-c++.dg/exceptions/exceptions-3.mm: New.
        * obj-c++.dg/exceptions/exceptions-4.mm: New.
        * obj-c++.dg/exceptions/exceptions-5.mm: New.

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

        * parser.c (cp_parser_objc_try_catch_finally_statement): Parse
        @catch(...)  and pass NULL_TREE to objc_begin_catch_clause() in
        that case.  Improved error recovery.  Reorganized code to be
        almost identical to c_parser_objc_try_catch_finally_statement.

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

        * c-parser.c (c_parser_objc_try_catch_statement): Renamed to
        c_parser_objc_try_catch_finally_statement for consistency with the
        C++ parser.  Parse @catch(...) and pass NULL_TREE to
        objc_begin_catch_clause() in that case.  Improved error recovery.
        Reorganized code to be almost identical to
        cp_parser_objc_try_catch_finally_statement.

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]