1 // RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic -std=c99
3 int __attribute__(()) x;
5 __inline void __attribute__((__always_inline__, __nodebug__))
10 __attribute__(()) y; // expected-warning {{defaults to 'int'}}
13 int (__attribute__(()) *z)(long y);
16 void f1(__attribute__(()) int x);
18 int f2(y, __attribute__(()) x); // expected-error {{expected identifier}}
20 // This is parsed as a normal argument list (with two args that are implicit
21 // int) because the __attribute__ is a declspec.
22 void f3(__attribute__(()) x, // expected-warning {{defaults to 'int'}}
23 y); // expected-warning {{defaults to 'int'}}
25 void f4(__attribute__(())); // expected-error {{expected parameter declarator}}
28 // This is ok, the __attribute__ applies to the pointer.
29 int baz(int (__attribute__(()) *x)(long y));
31 void g1(void (*f1)(__attribute__(()) int x));
32 void g2(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}}
33 void g3(void (*f3)(__attribute__(()) x, int y)); // expected-warning {{defaults to 'int'}}
34 void g4(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}}
37 void (*h1)(void (*f1)(__attribute__(()) int x));
38 void (*h2)(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}}
40 void (*h3)(void (*f3)(__attribute__(()) x)); // expected-warning {{defaults to 'int'}}
41 void (*h4)(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}}
47 int x, __attribute__((unused)) y, z;
52 void __attribute__((noreturn)) d0(void), __attribute__((noreturn)) d1(void);
54 void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn));