blob: 38b01759a7d448be58149e3ab390bca274c7f221 [file] [log] [blame]
Momchil Velikov57c681f2017-08-10 15:43:06 +00001// RUN: %clang_cc1 %s -std=c90 -verify -fsyntax-only
2void t0(int x) {
3 int (*p)();
4 if(x > 0)
5 x = g() + 1;
6 p = g;
7 if(x < 0) {
8 extern void u(int (*)[h()]);
9 int (*q)() = h;
10 }
11 p = h; /* expected-error {{use of undeclared identifier 'h'}} */
12}
13
14void t1(int x) {
15 int (*p)();
16 switch (x) {
17 g();
18 case 0:
19 x = h() + 1;
20 break;
21 case 1:
22 p = g;
23 p = h;
24 break;
25 }
26 p = g; /* expected-error {{use of undeclared identifier 'g'}} */
27 p = h; /* expected-error {{use of undeclared identifier 'h'}} */
28}
29
30int t2(int x) {
31 int y = ({ if (x > 0) x = g() + 1; 2*x; });
32 int (*p)() = g; /* expected-error {{use of undeclared identifier 'g'}} */
33 return y;
34}
35
36int (*p)() = g; /* expected-error {{use of undeclared identifier 'g'}} */
37int (*q)() = h; /* expected-error {{use of undeclared identifier 'h'}} */
38
39float g(); /* not expecting conflicting types diagnostics here */