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