diff options
author | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-01 01:44:12 +0000 |
---|---|---|
committer | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-01 01:44:12 +0000 |
commit | 4dfa7ebc6f20f3a753a6da36efaada673ec23523 (patch) | |
tree | 7f58bf31af2f4788ebcce144ba3eb984936a0960 /gcc/testsuite/objc.dg | |
parent | f27cea3abf8ded22456f5f46a812cc3915969815 (diff) | |
download | gcc-4dfa7ebc6f20f3a753a6da36efaada673ec23523.tar.gz |
[gcc/objc/ChangeLog]
2005-06-30 Ziemowit Laski <zlaski@apple.com>
* objc-act.c (objc_build_volatilized_type): New function.
(objc_volatilize_decl): Call objc_build_volatilized_type()
instead of build_qualified_type().
[gcc/testsuite/ChangeLog]
2005-06-30 Ziemowit Laski <zlaski@apple.com>
* obj-c++.dg/try-catch-11.mm: New.
* objc.dg/try-catch-10.m: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101493 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg')
-rw-r--r-- | gcc/testsuite/objc.dg/try-catch-10.m | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/try-catch-10.m b/gcc/testsuite/objc.dg/try-catch-10.m new file mode 100644 index 00000000000..1da1b47984a --- /dev/null +++ b/gcc/testsuite/objc.dg/try-catch-10.m @@ -0,0 +1,40 @@ +/* Ensure that @try/@catch blocks do not mess with types of + local objects (other than their volatile bits). */ + +/* { dg-options "-fobjc-exceptions -fnext-runtime" } */ +/* { dg-do compile } */ + +#include <objc/Object.h> + +@protocol Proto1 +- (int)meth1; +@end + +@protocol Proto2 +- (int)meth2; +@end + +@interface MyClass: Object <Proto2> { + int a; +} +- (int)meth2; +- (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2; +@end + +MyClass *mc1, *mc2; + +@implementation MyClass +- (int)meth2 { + return a; +} +- (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2 { + @try { + mc2 = p2; /* { dg-warning "type .id <Proto1>. does not conform to the .Proto2. protocol" } */ + } + @catch (id exc) { + return exc; + } + mc1 = p1; /* no warning here! */ + return self; +} +@end |