summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
diff options
context:
space:
mode:
authorAndi-Bogdan Postelnicu <abpostelnicu@me.com>2020-01-09 10:00:05 +0200
committerAndi-Bogdan Postelnicu <abpostelnicu@me.com>2020-01-09 13:52:26 +0200
commit795c38eb4df636d434a9821efecbfeb41ecba843 (patch)
tree092f81fdc98a2febd5c3f51d246829b56357a8f9 /clang-tools-extra
parent0d5407987a36445f21f122656edccbb0d9234f62 (diff)
downloadbcm5719-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.cpp13
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();
OpenPOWER on IntegriCloud