summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/default.c
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-02-14 22:14:32 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-02-14 22:14:32 +0000
commit800ddf3dda7b21f652da3d9720374997697f17e6 (patch)
treec4c8ce89332122705d7a8aaed4a1ebb43508b0b4 /clang/test/Sema/default.c
parent973cf9e8ae0a79c33d4e0f58af0b596ddd96faa1 (diff)
downloadbcm5719-llvm-800ddf3dda7b21f652da3d9720374997697f17e6.tar.gz
bcm5719-llvm-800ddf3dda7b21f652da3d9720374997697f17e6.zip
Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)
* if, switch, range-based for: warn if semicolon is on the same line. * for, while: warn if semicolon is on the same line and either next statement is compound statement or next statement has more indentation. Replacing the semicolon with {} or moving the semicolon to the next line will always silence the warning. Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp. llvm-svn: 150515
Diffstat (limited to 'clang/test/Sema/default.c')
-rw-r--r--clang/test/Sema/default.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/default.c b/clang/test/Sema/default.c
index 13186018450..429e63ae2a6 100644
--- a/clang/test/Sema/default.c
+++ b/clang/test/Sema/default.c
@@ -3,6 +3,6 @@
void f5 (int z) {
if (z)
default: // expected-error {{not in switch statement}}
- ; // expected-warning {{if statement has empty body}}
+ ;
}
OpenPOWER on IntegriCloud