1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 // Check C99 6.8.5p3
b1(void)4 void b1 (void) { for (void (*f) (void);;); }
b2(void)5 void b2 (void) { for (void f (void);;); }   // expected-error {{non-variable declaration in 'for' loop}}
b3(void)6 void b3 (void) { for (static int f;;); }    // expected-error {{declaration of non-local variable}}
b4(void)7 void b4 (void) { for (typedef int f;;); }   // expected-error {{non-variable declaration in 'for' loop}}
b5(void)8 void b5 (void) { for (struct { int i; } s;;); }
b6(void)9 void b6 (void) { for (enum { zero, ten = 10 } i;;); }
b7(void)10 void b7 (void) { for (struct s { int i; };;); } // expected-error {{non-variable declaration in 'for' loop}}
b8(void)11 void b8 (void) { for (static struct { int i; } s;;); } // expected-error {{declaration of non-local variable}}
b9(void)12 void b9 (void) { for (struct { int i; } (*s)(struct { int j; } o) = 0;;); }
b10(void)13 void b10(void) { for (typedef struct { int i; } (*s)(struct { int j; });;); } // expected-error {{non-variable declaration in 'for' loop}}
14