diff options
author | Chris Lattner <sabre@nondot.org> | 2012-04-28 16:24:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-04-28 16:24:20 +0000 |
commit | 70d4498899248bb1fff4ba9f9468cc08907d347d (patch) | |
tree | 12326d2493b0fff7784b6a1336d18610b2372d2b /clang/test/Parser/recovery.c | |
parent | f819ae609288e8904c1e772727c0b653805cba20 (diff) | |
download | bcm5719-llvm-70d4498899248bb1fff4ba9f9468cc08907d347d.tar.gz bcm5719-llvm-70d4498899248bb1fff4ba9f9468cc08907d347d.zip |
improve error recovery for extra ')'s after a if/switch/while condition. Before:
t.c:3:9: error: expected expression
if (x)) {
^
.. which isn't even true - a statement or expression is fine. After:
t.c:3:9: error: extraneous ')' after condition, expected a statement
if (x)) {
^
This is the second part of PR12595
llvm-svn: 155762
Diffstat (limited to 'clang/test/Parser/recovery.c')
-rw-r--r-- | clang/test/Parser/recovery.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/Parser/recovery.c b/clang/test/Parser/recovery.c index 3916acfda1e..178427e4b3c 100644 --- a/clang/test/Parser/recovery.c +++ b/clang/test/Parser/recovery.c @@ -37,8 +37,9 @@ void test(int a) { test(0); else ; - - if (x.i == 0)) // expected-error {{expected expression}} + + // PR12595 + if (x.i == 0)) // expected-error {{extraneous ')' after condition, expected a statement}} test(0); else ; |