[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / objc.dg / attributes / objc-exception-1.m
blobe7f6f856f8fa3c7e952a6e662353731e81624a5e
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, February 2011.  */
2 /* { dg-do compile } */
4 /* Test that the 'objc_exception' attribute is accepted for
5    @interfaces, but not for anything else.  */
7 #include <objc/objc.h>
9 /* Fine.  */
10 __attribute__ ((objc_exception))
11 @interface MyClass
13   Class isa;
15 @end
17 /* Fine.  */
18 __attribute__ ((__objc_exception__))
19 @interface MyClass2
21   Class isa;
23 @end
25 __attribute__ ((objc_exception))
26 @protocol MyProtocol; /* { dg-warning "ignored" } */
28 __attribute__ ((objc_exception))
29 int myVariable; /* { dg-warning "ignored" } */
31 __attribute__ ((objc_exception))
32 int myFunction (int argument); /* { dg-warning "ignored" } */