| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
// Decl annotations. |
| 4 |
void f(int __attribute__((maybe_undef)) *a); |
| 5 |
void (*fp)(int __attribute__((maybe_undef)) handle); |
| 6 |
__attribute__((maybe_undef)) int i(); // expected-warning {{'maybe_undef' attribute only applies to parameters}} |
| 7 |
int __attribute__((maybe_undef)) a; // expected-warning {{'maybe_undef' attribute only applies to parameters}} |
| 8 |
int (* __attribute__((maybe_undef)) fpt)(char *); // expected-warning {{'maybe_undef' attribute only applies to parameters}} |
| 9 |
void h(int *a __attribute__((maybe_undef("RandomString")))); // expected-error {{'maybe_undef' attribute takes no arguments}} |
| 10 |
|
| 11 |
// Type annotations. |
| 12 |
int __attribute__((maybe_undef)) ta; // expected-warning {{'maybe_undef' attribute only applies to parameters}} |
| 13 |
|
| 14 |
// Typedefs. |
| 15 |
typedef int callback(char *) __attribute__((maybe_undef)); // expected-warning {{'maybe_undef' attribute only applies to parameters}} |