diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-misleading-indentation %t +// RUN: %check_clang_tidy %s readability-misleading-indentation %t -- -- -fno-delayed-template-parsing void foo1(); void foo2(); @@ -169,6 +169,17 @@ } template +void mustFailNoInsta() { + if constexpr (b) { + foo1(); + } + else { + foo2(); + // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: different indentation for 'if' and corresponding 'else' [readability-misleading-indentation] + } +} + +template void mustPassNoInsta() { if constexpr (b) { foo1();