aaron.ballman added a reviewer: sbenza.
aaron.ballman added a subscriber: sbenza.
aaron.ballman added inline comments.


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4042
+/// \endcode
+AST_MATCHER_P(CXXNewExpr, operatorNew,
+              internal::Matcher<FunctionDecl>, InnerMatcher) {
----------------
Instead of adding a new traversal matcher for `operatorNew`, we could use the 
existing `hasDeclaration` traversal matcher and provide another overload for it.

The CXXNewExpr does expose the selected `operator delete` overload as well, so 
I'm not certain using `hasDeclaration` is perfect, but it was the first 
traversal matcher I could think of when trying to go from a new expression to 
the overloaded `operator new` declaration chosen for the expression (which is 
similar to `CallExpr` usage). @klimek or @sbenza, do you have a preference?


https://reviews.llvm.org/D26032



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

Reply via email to