llvm-project
8c4331c1 - [clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)

Commit
359 days ago
[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499) This implements the RFC https://discourse.llvm.org/t/rfc-introduce-clang-lifetime-capture-by-x/81371 In this PR, we introduce `[[clang::lifetime_capture_by(X)]]` attribute as discussed in the RFC. As an implementation detail of this attribute, we store and use param indices instead of raw param expressions. The parameter indices are computed lazily at the end of function declaration since the function decl (and therefore the subsequent parameters) are not visible yet while parsing a parameter annotation. In subsequent PR, we will infer this attribute for STL containers and perform lifetime analysis to detect dangling cases.
Author
Parents
Loading