[PATCH] D21241: Add an ASTMatcher for ignoring ExprWithCleanups.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 14:59:11 PDT 2016


aaron.ballman added inline comments.

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:629
@@ +628,3 @@
+/// \brief Matches expressions that match InnerMatcher after ExprWithCleanups
+/// are stripped off.
+AST_MATCHER_P(Expr, ignoringExprWithCleanups, internal::Matcher<Expr>,
----------------
This documentation is used to generate the public docs, so it should include examples with matchers (of what does and does not match). It's especially important because this AST matcher may not be obvious to everyone as to why you'd use it or what it applies to.

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:633
@@ +632,3 @@
+  auto E = &Node;
+  if (auto Cleanups = dyn_cast<ExprWithCleanups>(E))
+    E = Cleanups->getSubExpr();
----------------
Should be `auto *` (possibly const-qualified if you can get away with it).


http://reviews.llvm.org/D21241





More information about the cfe-commits mailing list