OSDN Git Service

* config/sh/sh.md (*movqi_pop): New insn pattern.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / try-catch-11.mm
1 /* Ensure that @try/@catch blocks do not mess with types of
2    local objects (other than their volatile bits).  */
3
4 /* { dg-options "-fobjc-exceptions" } */
5 /* { dg-do compile } */
6
7 #include "../objc-obj-c++-shared/Object1.h"
8
9 @protocol Proto1
10 - (int)meth1;
11 @end
12
13 @protocol Proto2
14 - (int)meth2;
15 @end
16
17 @interface MyClass: Object <Proto2> {
18   int a;
19 }
20 - (int)meth2;
21 - (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2;
22 @end
23
24 MyClass *mc1, *mc2;
25
26 @implementation MyClass
27 - (int)meth2 {
28   return a;
29 }
30 - (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2 {
31   @try {
32     mc2 = p2;   /* { dg-warning "type .id <Proto1>. does not conform to the .Proto2. protocol" } */
33   }
34   @catch (id exc) {
35     return exc;
36   }
37   mc1 = p1;  /* no warning here! */
38   return self;
39 }
40 @end