/* Contributed by Nicola Pero , November 2010. */ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ /* Test warnings when parsing syntax errors in @catch(). */ #include @interface MyObject { Class isa; } @end @implementation MyObject @end @interface MyObject2 { Class isa; } @end @implementation MyObject2 @end @protocol MyProtocol; int test (id object) { int dummy = 0; @try { @throw object; } @catch { /* { dg-error "expected" } */ dummy++; /* { dg-error "@catch parameter is not a known Objective-C class type" "" { target *-*-* } 35 } */ } @catch () /* { dg-error "expected identifier before" } */ { /* { dg-error "@catch parameter is not a known Objective-C class type" "" { target *-*-* } 38 } */ dummy++; } @catch (i) /* { dg-error ".i. has not been declared" } */ { /* { dg-error "@catch parameter is not a known Objective-C class type" "" { target *-*-* } 42 } */ dummy++; } @catch (id