ymandel added a comment.
Thanks for this fix!
================
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;
----------------
aaron.ballman wrote:
> Looks like the change introduced new curly braces for a single-line if.
Why is it necessary to check isElidable? I think the logic here is subtle
(since the AST doesn't explicitly tag implicit expressions), so please add an
explanatory comment.
================
Comment at: clang/lib/AST/ParentMapContext.cpp:163
if (const auto *C = dyn_cast<CXXConstructExpr>(E)) {
- if (C->getSourceRange() == SR || !isa<CXXTemporaryObjectExpr>(C))
+ if (C->getSourceRange() == SR || C->isElidable())
return true;
----------------
Same here. Please comment on the logic.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82278/new/
https://reviews.llvm.org/D82278
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits