mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-26 06:48:51 -04:00

int f(int x) { if (int foo = f(bar)) {} return 0; } Clang produces the following error messages: paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:26: error: expected ')' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:6: note: to match this '(' if (int foo = f(bar)) {} ^ The second error is incorrect. This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one. llvm-svn: 134258
16 lines
436 B
C++
16 lines
436 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
int f(int x) {
|
|
if (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
|
|
while (int foo = f(bar)) {} // expected-error{{use of undeclared identifier 'bar'}}
|
|
for (int foo = f(bar);;) {} // expected-error{{use of undeclared identifier 'bar'}}
|
|
|
|
int bar;
|
|
if (int foo = f(bar)) {}
|
|
while (int foo = f(bar)) {}
|
|
for (int foo = f(bar);;) {}
|
|
|
|
return 0;
|
|
}
|
|
|