1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-options "-fobjc-exceptions" } */
3 /* { dg-do compile } */
4 /* { dg-additional-options "-Wno-objc-root-class" } */
6 /* Test warnings when parsing syntax errors in @catch(). */
16 @implementation MyObject
25 @implementation MyObject2
34 @try { @throw object; }
36 { /* { dg-error "expected ... before ... token" } */
39 @catch () /* { dg-error "expected declaration specifiers or ..... before ..." } */
43 @catch (i) /* { dg-error "unknown type name .i." } */
47 @catch (id <MyProtocol x) /* { dg-error "expected ... before .x." } */
48 { /* { dg-error "'@catch' parameter cannot be protocol-qualified" "" { target *-*-* } .-1 } */
51 @catch MyObject *x /* { dg-error "expected ... before .MyObject." } */
55 @catch MyObject2 *x) /* { dg-error "expected ... before .MyObject2." } */
60 @try { @throw object; }
62 @catch (MyObject2 *y) /* { dg-error "expected ... before .catch." } */