1// RUN: clang-tidy %s -checks='-*,readability-braces-around-statements' -- -std=c++2b | count 0
2
3constexpr void handle(bool) {}
4
5constexpr void shouldPass() {
6 if consteval {
7 handle(true);
8 } else {
9 handle(false);
10 }
11}
12
13constexpr void shouldPassNegated() {
14 if !consteval {
15 handle(false);
16 } else {
17 handle(true);
18 }
19}
20
21constexpr void shouldPassSimple() {
22 if consteval {
23 handle(true);
24 }
25}
26
27void run() {
28 shouldPass();
29 shouldPassNegated();
30 shouldPassSimple();
31}
32

source code of clang-tools-extra/test/clang-tidy/checkers/readability/braces-around-statements-consteval-if.cpp