Debian Codegraph @

gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm

raw
1 /* Test that we get warnings for unrecognized attributes. */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-Wno-objc-root-class" } */
4
5 #include <objc/objc.h>
6
7 @interface MyRootClass
8 {
9 Class isa;
10 }
11 /* TODO: Emit warnings in the @interface as well. Currently we only emit
12 them in @implementation. */
13 + (id) method1: (id) __attribute__ ((xxxxx)) argument1;
14 + (id) method2: (id) __attribute__ ((noinline)) argument1;
15 @end
16
17 @implementation MyRootClass
18 + (id) method1: (id) __attribute__ ((xxxxx)) argument1 /* { dg-warning ".xxxxx. attribute directive ignored" } */
19 {
20 return argument1;
21 }
22 + (id) method2: (id) __attribute__ ((noinline)) argument1 /* { dg-warning ".noinline. attribute ignored" } */
23 {
24 return argument1;
25 }
26 @end