]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/pr68320.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr68320.c
1 /* PR c/68320 */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
4
5 void
6 fn1 (void)
7 {
8 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
9 if (1)
10 ;
11 T x; /* { dg-error "unknown type name" } */
12 }
13
14 void
15 fn2 (int i)
16 {
17 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
18 if (1)
19 i = 5;
20 T x; /* { dg-error "unknown type name" } */
21 }
22
23 void
24 fn3 (void)
25 {
26 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
27 if (1)
28 {
29 }
30 T *x; /* { dg-error "unknown type name" } */
31 }
32
33 void
34 fn4 (void)
35 {
36 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
37 if (1)
38 ;
39 T, T; /* { dg-error "undeclared" } */
40 }
41
42 void
43 fn5 (void)
44 {
45 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
46 if (1)
47 ;
48 T = 10; /* { dg-error "undeclared" } */
49 }
50
51 void
52 fn6 (void)
53 {
54 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
55 if (1)
56 ;
57 T[0]; /* { dg-error "undeclared" } */
58 }
59
60 void
61 fn7 (void)
62 {
63 for (typedef int T;;) /* { dg-error "declaration of non-variable" } */
64 if (1)
65 ;
66 T (); /* { dg-warning "implicit declaration" } */
67 }