1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-options "-fobjc-exceptions" } */
3 /* { dg-do compile } */
5 /* Test warnings when parsing syntax errors in @catch(). */
15 @implementation MyObject
24 @implementation MyObject2
33 @try { @throw object; }
35 { /* { dg-error "expected ... before ... token" } */
38 @catch () /* { dg-error "expected declaration specifiers or ..... before ..." } */
42 @catch (i) /* { dg-error "expected declaration specifiers or ..... before .i." } */
46 @catch (id <MyProtocol x) /* { dg-error "expected ... before .x." } */
47 { /* { dg-error "@catch parameter can not be protocol-qualified" "" { target *-*-* } 46 } */
50 @catch MyObject *x /* { dg-error "expected ... before .MyObject." } */
54 @catch MyObject2 *x) /* { dg-error "expected ... before .MyObject2." } */
59 @try { @throw object; }
61 @catch (MyObject2 *y) /* { dg-error "expected ... before .catch." } */