[PATCH] D139586: [Clang][C++23] Lifetime extension in range-based for loops
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 15 20:14:15 PST 2022
hubert.reinterpretcast added a comment.
At least on the surface, it looks like there will be a lot of trouble to deal with default arguments:
struct A { A(); ~A(); int x[3]; };
int (&f(const A & = A()))[3];
void bar(int);
void foo() {
for (auto e : f()) { bar(e); }
}
We get a `CXXDefaultArgExpr`, and the expression on the parameter declaration is what has the `MaterializeTemporaryExpr`. It looks like we now have cases where different call sites require different semantics (and perhaps different diagnostics, somewhat like template instantiations).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139586/new/
https://reviews.llvm.org/D139586
More information about the cfe-commits
mailing list