[PATCH] D31700: [clang-tidy] Ignore blank spaces between cast's ")" and its sub expr.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 08:15:21 PDT 2017


hokein added a comment.

> You might want to commit this at some point ;]

I somewhat forgot this minor patch.



================
Comment at: clang-tidy/google/AvoidCStyleCastsCheck.cpp:139
           ")");
+      ReplaceRange = CharSourceRange::getCharRange(CastExpr->getLParenLoc(),
+                                                   SubExpr->getLocStart());
----------------
alexfh wrote:
> Why is this only done on non-parenthesized expressions? Will `(int)  (b)` turn into `static_cast<int>  (b)` as well?
Good point, I have updated the patch to cover more cases. Please take a look again.


https://reviews.llvm.org/D31700





More information about the cfe-commits mailing list