diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-18 20:28:07 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-18 20:28:07 +0000 |
commit | 33b3681f2e2eacf55e90ae1d74fa4643323a9370 (patch) | |
tree | 7e133229359caed0887f2fb805a0c54ecaa63de2 /gcc/testsuite/objc.dg/fobjc-exceptions-1.m | |
parent | 8839e37242e3e2fedd56cc73fe1d9d6266ada09f (diff) | |
download | gcc-33b3681f2e2eacf55e90ae1d74fa4643323a9370.tar.gz |
In gcc/:
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_try_catch_finally_statement): Call
objc_maybe_warn_exceptions.
(c_parser_objc_synchronized_statement): Call
objc_maybe_warn_exceptions.
In gcc/cp/:
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_try_catch_finally_statement): Call
objc_maybe_warn_exceptions.
(cp_parser_objc_synchronized_statement): Same change.
In gcc/c-family/:
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* c-objc.h (objc_maybe_warn_exceptions): New.
* stub-objc.c (objc_maybe_warn_exceptions): New.
In gcc/objc/:
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_init): Call using_eh_for_cleanups.
(objc_init_exceptions): Renamed to objc_maybe_warn_exceptions. Do
not call using_eh_for_cleanups.
(objc_begin_try_stmt): Do not call objc_init_exceptions.
(objc_build_throw_stmt): Updated call to
objc_maybe_warn_exceptions.
In gcc/testsuite/:
2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/fobjc-exceptions-1.m: Updated.
* objc.dg/fobjc-exceptions-2.m: New.
* objc.dg/fobjc-exceptions-3.m: New.
* obj-c++.dg/fobjc-exceptions-1.mm: New.
* obj-c++.dg/fobjc-exceptions-2.mm: New.
* obj-c++.dg/fobjc-exceptions-3.mm: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg/fobjc-exceptions-1.m')
-rw-r--r-- | gcc/testsuite/objc.dg/fobjc-exceptions-1.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/fobjc-exceptions-1.m b/gcc/testsuite/objc.dg/fobjc-exceptions-1.m new file mode 100644 index 00000000000..8cee4d84909 --- /dev/null +++ b/gcc/testsuite/objc.dg/fobjc-exceptions-1.m @@ -0,0 +1,28 @@ +/* Test that Objective-C exceptions cause an error with -fobjc-exceptions. */ +/* { dg-do compile } */ + +@class Object; + +int dummy (int number, Object *o) +{ + @try { /* { dg-error ".-fobjc-exceptions. is required to enable Objective-C exception syntax" } */ + number++; + @throw o; /* Nothing, error has already been produced. */ + } + @catch (id object) + { + number++; + @throw; /* Nothing, error has already been produced. */ + } + @finally + { + number++; + } + + @synchronized (o) /* Nothing, error has already been produced. */ + { + number++; + } + + return number; +} |