xref: /aosp_15_r20/external/clang/test/Parser/parenthesis-balance.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify %s
2*67e74705SXin Li 
f(int x)3*67e74705SXin Li int f(int x) {
4*67e74705SXin Li   if (int foo = f(bar)) {}     // expected-error{{use of undeclared identifier 'bar'}}
5*67e74705SXin Li   while (int foo = f(bar)) {}  // expected-error{{use of undeclared identifier 'bar'}}
6*67e74705SXin Li   for (int foo = f(bar);;) {}  // expected-error{{use of undeclared identifier 'bar'}}
7*67e74705SXin Li 
8*67e74705SXin Li   int bar;
9*67e74705SXin Li   if (int foo = f(bar)) {}
10*67e74705SXin Li   while (int foo = f(bar)) {}
11*67e74705SXin Li   for (int foo = f(bar);;) {}
12*67e74705SXin Li 
13*67e74705SXin Li   return 0;
14*67e74705SXin Li }
15*67e74705SXin Li 
16