mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 09:06:07 +00:00

* 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
9 lines
146 B
C
9 lines
146 B
C
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
void f5 (int z) {
|
|
if (z)
|
|
default: // expected-error {{not in switch statement}}
|
|
;
|
|
}
|
|
|