[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 07:42:06 PDT 2017

alexfh added inline comments.

Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:40-42
+  for (auto Iter = ChainedIfs.find(If); Iter != ChainedIfs.end();
+       Iter = ChainedIfs.find(Iter->second))
+    IfLoc = Iter->second->getIfLoc();
alexfh wrote:
> Can you just use the parent map to get the previous `if` in the chain?
`ASTContext::getParents` is the interface to it.


More information about the cfe-commits mailing list