For code such as:<div><br></div><div><div>int f(int x) {</div><div>  if (int foo = f(bar)) {}</div></div><div>  return 0;</div><div>}</div><div><br></div><div>Clang produces the following error messages:</div><div><br></div>
<div><div>paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar'</div><div>  if (int foo = f(bar)) {}</div><div>                  ^</div><div>paren_imbalance.cc:2:26: error: expected ')'</div><div>
  if (int foo = f(bar)) {}</div><div>                        ^</div><div>paren_imbalance.cc:2:6: note: to match this '('</div><div>  if (int foo = f(bar)) {}</div><div>     ^</div></div><div><br></div><div>The first error is correct.  The next error and note come the parser attempting to recover.  The recovery consumes the right parenthesis too early leading to Clang thinking there is a parenthesis imbalance when there isn't one.  This patch should fix this issue.</div>