[clang-tools-extra] 795c38e - [clang-tidy] For checker `readability-misleading-indentation` update tests.
Andi-Bogdan Postelnicu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 9 03:52:48 PST 2020
Author: Andi-Bogdan Postelnicu
Date: 2020-01-09T13:52:26+02:00
New Revision: 795c38eb4df636d434a9821efecbfeb41ecba843
URL: https://github.com/llvm/llvm-project/commit/795c38eb4df636d434a9821efecbfeb41ecba843
DIFF: https://github.com/llvm/llvm-project/commit/795c38eb4df636d434a9821efecbfeb41ecba843.diff
LOG: [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
Added:
Modified:
clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp
Removed:
################################################################################
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 c3bd33d8ee7b..aea0618d120d 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();
@@ -168,6 +168,17 @@ void mustFailNonTemplate() {
// CHECK-MESSAGES: :[[@LINE-2]]:5: warning:
diff erent indentation for 'if' and corresponding 'else' [readability-misleading-indentation]
}
+template<bool b>
+void mustFailNoInsta() {
+ if constexpr (b) {
+ foo1();
+ }
+ else {
+ foo2();
+ // CHECK-MESSAGES: :[[@LINE-2]]:5: warning:
diff erent indentation for 'if' and corresponding 'else' [readability-misleading-indentation]
+ }
+}
+
template<bool b>
void mustPassNoInsta() {
if constexpr (b) {
More information about the cfe-commits
mailing list