[libc++] Add [[clang::lifetimebound]] attribute to std::forward and friends
authorNikolas Klauser <nikolasklauser@berlin.de>
Mon, 9 Jan 2023 21:27:06 +0000 (22:27 +0100)
committerNikolas Klauser <nikolasklauser@berlin.de>
Sat, 14 Jan 2023 01:54:33 +0000 (02:54 +0100)
commit277a9f6e5f85bfa1c58ca21c26a5a74326f002ff
tree8a37e6e291ca5bc511c2c2e5b876d9f7bda3f1be
parentdc9c41125caa07b4f4ad0b6cb3348b499dbcf3a5
[libc++] Add [[clang::lifetimebound]] attribute to std::forward and friends

This allows clang to catch lifetime bugs through these functions.
As a drive-by, replace `_LIBCPP_INLINE_VISIBILITY` with `_LIBCPP_HIDE_FROM_ABI`.
Fixes #59900

Reviewed By: ldionne, #libc

Spies: rsmith, rnk, aaron.ballman, libcxx-commits

Differential Revision: https://reviews.llvm.org/D141321
libcxx/include/__config
libcxx/include/__utility/forward.h
libcxx/include/__utility/forward_like.h
libcxx/include/__utility/move.h
libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp [new file with mode: 0644]