blob: 5bfa6396039a4d812adf9ec4b90a22bcab69304b [file] [log] [blame]
Richard Trieu31fd2b72011-07-01 20:54:02 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3int f(int x) {
4 if (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
5 while (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
6 for (int foo = f(bar);;) {} // expected-error{{use of undeclared identifier 'bar'}}
7
8 int bar;
9 if (int foo = f(bar)) {}
10 while (int foo = f(bar)) {}
11 for (int foo = f(bar);;) {}
12
13 return 0;
14}
15