[PATCH] D27700: [clang-tidy] refactor ExprSequence out of misc-use-after-move check

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 08:41:59 PST 2016


mboehme accepted this revision.
mboehme added a comment.
This revision is now accepted and ready to land.

LG apart from minor comments by others and me



================
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:18
 using namespace clang::ast_matchers;
+using namespace clang::tidy::utils;
+
----------------
Prazek wrote:
> Prazek wrote:
> > I don't think it is required
> ok I guess I am wrong
I would suggest instead adding an explicit "utils::" qualifier -- it's only needed in two places anyway. I don't feel strongly about this though.


================
Comment at: clang-tidy/utils/ExprSequence.cpp:52
+
+bool isDescendantOrEqual(const Stmt *Descendant, const Stmt *Ancestor,
+                         ASTContext *Context) {
----------------
Prazek wrote:
> staronj wrote:
> > Shouldn't isDescendantOrEqual be static or in inline namespace?
> Goot catch. I guess putting it with getParentStmts into anonymous namespace is the best solution.
> btw inline namespace is not the same as anonymous namespace :)
Thanks for the catch -- this was already a bug in the original code...


================
Comment at: clang-tidy/utils/ExprSequence.cpp:179
+
+
+}
----------------
Double newline


================
Comment at: clang-tidy/utils/ExprSequence.h:120
+
+
+}
----------------
Double newline


https://reviews.llvm.org/D27700





More information about the cfe-commits mailing list