[PATCH] D19586: Misleading Indentation check

Pauer Gergely via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 5 11:14:25 PDT 2016


Pajesz marked 12 inline comments as done.
Pajesz added a comment.

so i have to submit K good to know


================
Comment at: test/clang-tidy/readability-misleading-indentation.cpp:48
@@ +47,3 @@
+   }
+      foo2();  // ok
+
----------------
nlewycky wrote:
> This is arguably misleading indentation, but I'm ok with not warning on it if you think it will cause too many false positives.
Since brackets are used I don't think we should warn about it. It would indeed cause man false positives.

================
Comment at: test/clang-tidy/readability-misleading-indentation.cpp:63
@@ +62,3 @@
+    foo2();
+  }
+
----------------
alexfh wrote:
> alexfh wrote:
> > What about this comment?
> What about this comment?
The checker doesn't work for macro's I don't know why and how to fix it so I just ignored it.

================
Comment at: test/clang-tidy/readability-misleading-indentation.cpp:16
@@ +15,3 @@
+              // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: wrong indentation, 'else' belongs to 'if(cond2)' statement
+              // CHECK-FIXES: {{^}}  // comment1
+
----------------
alexfh wrote:
> Did you run the tests after changes? I don't think the `// comment1` line can actually appear in the fixed code, when it's not there before the fix.
Could you please explain what check-fixes does and how? Im not sure about it.


https://reviews.llvm.org/D19586





More information about the cfe-commits mailing list