OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [try-catch-10.m] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* 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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.