[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 13:42:14 PST 2024


================
@@ -238,3 +239,236 @@ void init_capture_init_list() {
   // CHECK: call {{.*}}dtor
   // CHECK: }
 }
+
+namespace P2718R0 {
----------------
shafik wrote:

Is it possible to also test the case where it does not clean up like in the proposal:

```cpp
for (auto e : f2(g())) {}  // undefined behavior
```


https://github.com/llvm/llvm-project/pull/76361


More information about the cfe-commits mailing list