1 // RUN: %clang_cc1 -fsyntax-only -Wextra -std=c++2a -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -Wextra-semi-stmt -std=c++2a -verify %s
3 // RUN: %clang_cc1 -fsyntax-only -Wempty-init-stmt -std=c++2a -verify %s
5 // RUN: %clang_cc1 -x c++ -Wempty-init-stmt -std=c++2a -fixit %t
6 // RUN: %clang_cc1 -x c++ -Wempty-init-stmt -std=c++2a -Werror %t
14 if (; true) // expected-warning {{empty initialization statement of 'if' has no effect}}
17 switch (; x
) { // expected-warning {{empty initialization statement of 'switch' has no effect}}
20 for (; int y
: S()) // expected-warning {{empty initialization statement of 'range-based for' has no effect}}
29 void with_null_macro(int x
) {
33 switch (NULLMACRO
; x
) {
36 for (NULLMACRO
; int y
: S())
42 void with_semi_macro(int x
) {
46 switch (SEMIMACRO x
) {
49 for (SEMIMACRO
int y
: S())
53 #define PASSTHROUGHMACRO(x) x
55 void with_passthrough_macro(int x
) {
56 if (PASSTHROUGHMACRO(;) true)
59 switch (PASSTHROUGHMACRO(;) x
) {
62 for (PASSTHROUGHMACRO(;) int y
: S())