1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
2 /* { dg-options "-fobjc-exceptions" } */
3 /* { dg-do compile } */
5 /* Test warnings when the argument of @throw is invalid. */
11 struct x { int i; } invalid_1, *invalid_2;
13 @throw object; /* Ok */
14 @throw 1; /* { dg-error ".@throw. argument is not an object" } */
15 @throw "string"; /* { dg-error ".@throw. argument is not an object" } */
16 @throw invalid_1; /* { dg-error ".@throw. argument is not an object" } */
17 @throw invalid_2; /* { dg-error ".@throw. argument is not an object" } */