This revision was automatically updated to reflect the committed changes. Closed by commit rG795c38eb4df6: [clang-tidy] For checker `readability-misleading-indentation` update tests. (authored by Andi-Bogdan Postelnicu <abposteln...@me.com>).
Changed prior to commit: https://reviews.llvm.org/D72438?vs=236971&id=237008#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72438/new/ https://reviews.llvm.org/D72438 Files: clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp Index: clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp +++ 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<bool b> +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<bool b> void mustPassNoInsta() { if constexpr (b) { foo1();
Index: clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp +++ 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<bool b> +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<bool b> void mustPassNoInsta() { if constexpr (b) { foo1();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits