1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3void f1(int a) {
4    if (a); // expected-warning {{if statement has empty body}}
5}
6
7void f2(int a) {
8    if (a) {}
9}
10
11void f3() {
12  if (1)
13    xx;      // expected-error {{use of undeclared identifier}}
14  return;    // no empty body warning.
15}
16
17// Don't warn about an empty body if is expanded from a macro.
18void f4(int i) {
19  #define BODY(x)
20  if (i == i) // expected-warning{{self-comparison always evaluates to true}}
21    BODY(0);
22  #undef BODY
23}
24
25template <typename T>
26void tf() {
27  #define BODY(x)
28  if (0)
29    BODY(0);
30  #undef BODY
31}
32
33void f5() {
34    tf<int>();
35}
36