parenthesis-balance.cpp 436 B

123456789101112131415
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. int f(int x) {
  3. if (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
  4. while (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
  5. for (int foo = f(bar);;) {} // expected-error{{use of undeclared identifier 'bar'}}
  6. int bar;
  7. if (int foo = f(bar)) {}
  8. while (int foo = f(bar)) {}
  9. for (int foo = f(bar);;) {}
  10. return 0;
  11. }