[PATCH] D70638: [Diagnostic] add a warning which warns about misleading indentation

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 30 03:13:29 PST 2019


xbolva00 added inline comments.


================
Comment at: clang/lib/Parse/ParseStmt.cpp:1239
+  ~MisleadingIndentationChecker() {
+    assert(!NeedsChecking && "Check Has not been called");
+  }
----------------
I dont think we need this.

Tests will fail anyway if someone removes check() calls.


================
Comment at: clang/lib/Parse/ParseStmt.cpp:1376
+
+    MIChecker.Check(ElseStmt.isUsable());
 
----------------
What is wrong with code you used some rev ago?

if (usable) check();

Now you uselessly instantiate MIChecker since if Usable = false, check is not called.

I like the older code more...

If (usable) checkForMisleadingIndention(...) 

Was good and accepted.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70638/new/

https://reviews.llvm.org/D70638





More information about the cfe-commits mailing list