sbenza added a comment.

The reason we haven't fixed hasAnyArgument is that it can potentially break its 
users.
I'd prefer if you separated the fix from the addition.
That way we can revert the fix if needed.


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4796
@@ +4795,3 @@
+/// \endcode
+/// hasReturnValue(binaryOperator())
+///   matches 'return a+b'
----------------
New matchers must be tested.
See ASTMatchersTest.cpp.

Also, they should be added to the dynamic registry.
See Dynamic/Registry.cpp

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4800
@@ +4799,3 @@
+///   matching 'a+b'
+AST_MATCHER_P(ReturnStmt, hasReturnValue, internal::Matcher<Expr>, 
InnerMatcher) {
+  BoundNodesTreeBuilder Result(*Builder);
----------------
I'm not sure this is needed.
`returnStmt(hasReturnValue(...))` is equivalent to `returnStmt(has(...))`
There are many checks using the latter already.


http://reviews.llvm.org/D17986



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to