summaryrefslogtreecommitdiffstats
path: root/tools/clang-tidy/test/readability-braces-around-statements.cpp
blob: 2a08b51bc9216c291b0d8081b05440d66f283ef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void do_something(const char *) {}

bool cond(const char *) {
  return false;
}

void test() {
if (cond("if0") /*comment*/) do_something("same-line");
}

void foo() {
if (1) while (2) if (3) for (;;) do ; while(false) /**/;/**/
}

void f() {}

void foo2() {
  constexpr bool a = true;
  if constexpr (a) {
    f();
  } else {
    f();
  }
}