[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
Mon Oct 21 15:58:48 PDT 2024
ldionne wrote:
I think this could be interesting. Could you add a description of the benefit of this change? I know the linked issue explains it a bit, but it's good to have PRs be self-standing.
Could you also add a couple of tests showing what kind of scenarios we're now diagnosing that we were not diagnosing before? That would make the benefits of this change more concrete.
In https://github.com/llvm/llvm-project/issues/59900#issuecomment-1399068948, @zygoloid mentioned that Clang was now inferring the attribute on some libc++ functions. Does it do that by hardcoding the names of some libc++ functions, or is there some other "intelligent" mechanism that it's using to do that? If the latter, it would be good to understand what it's doing to determine whether the additional attributes in this patch should be hardcoded in libc++ or done via Clang.
At a glance, I'd much rather be explicit about these attributes inside libc++ than magically have the compiler annotate our declarations.
CC @egorzhdan @Xazax-hun for awareness
https://github.com/llvm/llvm-project/pull/112751
More information about the libcxx-commits
mailing list