[llvm] [ADT] Add `[[clang::lifetimebound]]` annotations to Twine.h (PR #210474)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 18 07:56:43 PDT 2026
isuckatcs wrote:
> Do you see potential downsides of adding these and potentially more lifetime attributes to relevant ADT classes/functions?
We might add the to the wrong places, and false positives start to appear. Also, in some cases even in `Twine` the annotation is valid for some cases, but invalid for some other cases at the same place. See https://github.com/llvm/llvm-project/pull/210474#discussion_r3608497630 for an example.
In this case, we either see false positives appearing, or we change the API to try to avoid them, which can lead to more code changes. We might only annotate places that should be annotated in 100% of the cases, and leave the 50/50 cases unannotated. This results in false negatives instead, but I guess it is better than a false positive.
https://github.com/llvm/llvm-project/pull/210474
More information about the llvm-commits
mailing list