1 | // RUN: %check_clang_tidy -std=c++23 %s readability-else-after-return %t |
---|---|
2 | |
3 | // Consteval if is an exception to the rule, we cannot remove the else. |
4 | void f() { |
5 | if (sizeof(int) > 4) { |
6 | return; |
7 | } else { |
8 | return; |
9 | } |
10 | // CHECK-MESSAGES: [[@LINE-3]]:5: warning: do not use 'else' after 'return' |
11 | |
12 | if consteval { |
13 | return; |
14 | } else { |
15 | return; |
16 | } |
17 | } |
18 |