[libcxx-commits] [libcxx] Add [[clang::lifetimebound]] to numerous functions in libc++ include headers (PR #112751)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 22 06:14:33 PDT 2024
ldionne wrote:
Thanks a lot for the breakdown @zygoloid!
I think I agree with where you draw the line, i.e. `std::forward` is truly a builtin defined by Clang so it makes sense for Clang to decide on its attributes, but for e.g. `std::string_view` constructors it's arguably stretching it. Generally speaking, libc++ should be consulted before making changes to libc++'s API, even if those changes are achieved by modifications to the compiler. @hokein Could we move the inference of those attributes from being hardcoded in clang to the library?
As far as this draft PR goes, I think I agree with the approach which is to simply slap the attribute to declarations in libc++ that can benefit from it. I'd like to better understand what are the benefits of doing that and how far we want to go down this rabbit hole, but assuming there are diagnostics improvements to be had, I think this is something worth exploring.
https://github.com/llvm/llvm-project/pull/112751
More information about the libcxx-commits
mailing list