30 lines · cpp
1// RUN: %check_clang_tidy -std=c++17-or-later %s readability-misleading-indentation %t -- -- -fno-delayed-template-parsing2 3namespace PR61435 {4 5template<int N>6constexpr auto lam_correct = []{7 if constexpr (N == 1) {8 } else {9 }10};11 12template<int N>13constexpr auto lam_incorrect = []{14 if constexpr (N == 1) {15 }16 else {17 }18 // CHECK-MESSAGES: :[[@LINE-2]]:4: warning: different indentation for 'if' and corresponding 'else' [readability-misleading-indentation]19};20 21void test() {22 lam_correct<1>();23 lam_correct<2>();24 25 lam_incorrect<1>();26 lam_incorrect<2>();27}28 29}30