[PATCH] D72438: [clang-tidy] For checker `readability-misleading-indentation` update tests.

Andi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 00:06:53 PST 2020


Abpostelnicu created this revision.
Abpostelnicu added a reviewer: JonasToth.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a project: clang.
Abpostelnicu edited the summary of this revision.
Abpostelnicu added a project: clang-tools-extra.

In D72333 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

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();
@@ -168,6 +168,17 @@
   // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: different 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: different indentation for 'if' and corresponding 'else' [readability-misleading-indentation]
+  }
+}
+
 template<bool b>
 void mustPassNoInsta() {
   if constexpr (b) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72438.236971.patch
Type: text/x-patch
Size: 1044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200109/3c5f434b/attachment.bin>


More information about the cfe-commits mailing list