Debian Codegraph @

gcc/testsuite/obj-c++.dg/try-catch-15.mm

raw
1 /* Test if addition of 'volatile' to object causes bogus error in presence of try-catch. */
2 /* { dg-options "-fobjc-exceptions" } */
3 /* { dg-do compile } */
4
5 @interface Exception
6 @end
7
8 class CppObj {
9 public:
10 void constMethod() const {
11 }
12 };
13
14 @interface MyObject : Exception
15 - (void)doSomething;
16 - (void)myMethod;
17 @end
18
19 @implementation MyObject
20 - (void)doSomething {
21 }
22
23 - (void)myMethod {
24 CppObj cppObj;
25
26 @try {
27 [self doSomething];
28 }
29 @catch (Exception *exception) {
30 }
31
32 cppObj.constMethod();
33 }
34 @end