diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-18 00:52:05 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-18 00:52:05 +0000 |
commit | 0875c53239dde03319099d8ae4ac12a4025709e8 (patch) | |
tree | 7649b32a1e208b22e0d951a72764cb8ba0697347 /clang/test/FixIt/fixit.c | |
parent | 5657555357af46e44a1970f7a7aa8f5ced35aa79 (diff) | |
download | bcm5719-llvm-0875c53239dde03319099d8ae4ac12a4025709e8.tar.gz bcm5719-llvm-0875c53239dde03319099d8ae4ac12a4025709e8.zip |
If a comma operator is followed by a token which unambiguously indicates the
start of a statement or the end of a compound-statement, diagnose the comma as
a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and
minor refactoring by me.
llvm-svn: 164085
Diffstat (limited to 'clang/test/FixIt/fixit.c')
-rw-r--r-- | clang/test/FixIt/fixit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit.c b/clang/test/FixIt/fixit.c index ce6f1092df1..00adb19e50c 100644 --- a/clang/test/FixIt/fixit.c +++ b/clang/test/FixIt/fixit.c @@ -81,6 +81,13 @@ void oopsMoreCommas() { &a == &b ? oopsMoreCommas() : removeUnusedLabels(a[0]); } +int commaAtEndOfStatement() { + int a = 1; + a = 5, // expected-error {{';'}} + int m = 5, // expected-error {{';'}} + return 0, // expected-error {{';'}} +} + int noSemiAfterLabel(int n) { switch (n) { default: |