1 /* Test C2x attribute syntax. Test GNU attributes appertain to
2 appropriate constructs. Attributes on types not being defined at
4 /* { dg-do compile } */
5 /* { dg-options "-std=gnu2x -Wformat" } */
7 typedef void va_type (const char *, ...);
8 typedef va_type
[[gnu::format (printf
, 1, 2)]] printf_like_1
;
9 typedef void printf_like_2 (const char *, ...) [[gnu::format (printf
, 1, 2)]];
10 typedef __typeof__ (void (const char *, ...) [[gnu::format (printf
, 1, 2)]])
17 va_type
[[gnu::format (printf
, 1, 2)]] *func5 (void);
23 func2 ("%s", 1); /* { dg-warning "expects argument" } */
24 func3 ("%s", 1); /* { dg-warning "expects argument" } */
25 func4 ("%s", 1); /* { dg-warning "expects argument" } */
26 func5 () ("%s", 1); /* { dg-warning "expects argument" } */
31 __typeof__ (int [[gnu::deprecated
]]) var1
; /* { dg-warning "deprecated" } */
32 __typeof__ (A
[[gnu::deprecated
]]) var2
; /* { dg-warning "deprecated" } */
33 __typeof__ (int [3] [[gnu::deprecated
]]) var3
; /* { dg-warning "deprecated" } */