ahatanak wrote:
I'm not sure that's going to work. Consider this code:
```
void f2(S, S);
void test() {
S s1, s2;
static auto b = ^(void) {
f2(s1, s2);
return 0;
};
b();
}
```
The captured objects (`s1` and `s2`) have to be kept alive at least until the
call (`b()`) in this case, so the destructors cannot run at the end of the full
expression.
https://github.com/llvm/llvm-project/pull/199508
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits