[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 15:55:05 PDT 2024


https://github.com/zygoloid commented:

Please can you also add tests for the case where the default argument is a pointer, eg:
```c++
using T = int[];
int *f([[clang::lifetimebound]] int *p = T{1, 2, 3});
int *p = f();
```
I expect that won't be caught, and you'll need to make a similar change to `visitLocalsRetainedByInitializer` to handle it.

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


More information about the cfe-commits mailing list