[PATCH] D82278: Fix traversal over CXXConstructExpr in Syntactic mode
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 08:04:10 PDT 2020
aaron.ballman added reviewers: rsmith, sammccall.
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp:80
auto Matches =
- match(expr(hasDescendant(typeLoc().bind("t"))), *E, *Result.Context);
+ match(traverse(TK_AsIs, expr(hasDescendant(typeLoc().bind("t")))), *E,
+ *Result.Context);
----------------
While I believe the change is necessary here, it's not obvious to me what "hints" tell me this behavior is correct for the given matchers. None of the matchers look like they're going to care about implicit nodes, so how am I to know that AsIs is correct or not as a reviewer? As it stands, I sort of feel like I have to take it on faith that this change is correct and it looks a little suspicious because the code using the matcher is creating a fix-it at what now may be the location of an implicit node.
================
Comment at: clang/lib/AST/Expr.cpp:3001
Expr *A = C->getArg(0);
- if (A->getSourceRange() == SR || !isa<CXXTemporaryObjectExpr>(C))
+ if (A->getSourceRange() == SR || C->isElidable()) {
E = A;
----------------
Looks like the change introduced new curly braces for a single-line if.
================
Comment at: clang/lib/AST/ParentMapContext.cpp:157
+ if (auto *C = dyn_cast<CXXFunctionalCastExpr>(E)) {
+ if (C->getSourceRange() == SR)
----------------
`const auto *`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82278/new/
https://reviews.llvm.org/D82278
More information about the cfe-commits
mailing list