Open
Description
A suggestion that I wanted to relay:
In the spirit of #59900 and #60020, how about adding [[clang::lifetimebound]]
to other functions as well?
Containers in particular seem to have many methods that could benefit from this attribute, including back()
, begin()
, data()
, emplace_back()
, find()
, insert()
, operator[]
, etc., since all of their outputs require the container to be alive for validity.
Beyond containers, I think this could be similarly used for functions such as std::unique_ptr::get()
, std::variant::get_if()
, etc.