diff options
author | Andi-Bogdan Postelnicu <abpostelnicu@me.com> | 2020-01-09 10:00:05 +0200 |
---|---|---|
committer | Andi-Bogdan Postelnicu <abpostelnicu@me.com> | 2020-01-09 13:52:26 +0200 |
commit | 795c38eb4df636d434a9821efecbfeb41ecba843 (patch) | |
tree | 092f81fdc98a2febd5c3f51d246829b56357a8f9 /clang-tools-extra | |
parent | 0d5407987a36445f21f122656edccbb0d9234f62 (diff) | |
download | bcm5719-llvm-795c38eb4df636d434a9821efecbfeb41ecba843.tar.gz bcm5719-llvm-795c38eb4df636d434a9821efecbfeb41ecba843.zip |
[clang-tidy] For checker `readability-misleading-indentation` update tests.
Summary: In D72333 we've introduced support for `if constexpr` but the test for uninstantiated template was not ready to land on windows platform since this target uses `-fdelayed-template-parsing` by default. This patch addresses this by passing `-fno-delayed-template-parsing` to the test.
Reviewers: JonasToth
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72438
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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 index c3bd33d8ee7..aea0618d120 100644 --- 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 @@ void mustFailNonTemplate() { } 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(); |