[libcxx-commits] [PATCH] D141321: [libc++] Add [[clang::lifetimebound]] attribute to std::forward and friends

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 10 10:36:12 PST 2023


philnik added a comment.

In D141321#4040624 <https://reviews.llvm.org/D141321#4040624>, @ldionne wrote:

> Thanks! This is a nice improvement IMO.
>
> However, the CI issue you're seeing is actually a very interesting and slightly deeper issue. Indeed, remember when Clang decided to define `forward` and `move` as builtins in D123345 <https://reviews.llvm.org/D123345>? One impact of that change is that we don't control our `std::forward` and `std::move` anymore, so we'd need to make the change in this patch inside Clang, not inside libc++. An obvious follow-up question is then do we make the change in Clang and strive to keep libc++ in synchronization with how Clang defines `std::forward`? Or do we not care about keeping them in sync? Should we have a way to ensure that both definitions stay in sync?
>
> CC Clang folks @rnk @rsmith @aaron.ballman

I'm not sure how clang handles this, but the warnings get emitted. It's just that I forgot to guard `std::forward_like` pre-C++23. I guess it just adds the attributes to the builtin declaration magically.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141321/new/

https://reviews.llvm.org/D141321



More information about the libcxx-commits mailing list