[PATCH] D70368: [clang-tidy] Rewrite modernize-avoid-bind check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 23 12:58:35 PST 2019


aaron.ballman accepted this revision.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM once you handle the last remaining nits from @Eugene.Zelenko.



================
Comment at: clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:116
+static const Expr *ignoreTemporariesAndImplicitCasts(const Expr *E) {
+  if (const auto *T = dyn_cast<MaterializeTemporaryExpr>(E))
+    return ignoreTemporariesAndImplicitCasts(T->GetTemporaryExpr());
----------------
zturner wrote:
> aaron.ballman wrote:
> > What about `CXXBindTemporaryExpr`?
> > 
> > Would `Expr::IgnoreImplicit()` do too much stripping because it removes `FullExpr` as well?
> I don't actually know.  This patch is literally my first exposure to clang's frontend and AST manipulations, so I was kind of just trying different things until something worked here.  I didn't even know about `IgnoreImplicit()` or `FullExpr`.  I'll play around with them and report back.
Unless you find some reason why they're critical in the initial version of your patch, I'm fine handling this as a follow-up if needed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70368/new/

https://reviews.llvm.org/D70368





More information about the cfe-commits mailing list