[PATCH] D40144: Implement `std::launder`

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 14:31:12 PST 2017


rsmith added a comment.

In https://reviews.llvm.org/D40144#927866, @hfinkel wrote:

> In https://reviews.llvm.org/D40144#927828, @tcanens wrote:
>
> > At least for GCC, it should use `__builtin_launder`.
>
>
> I presume we'll need to add something similar for Clang as well.


Yes, we agreed to use the same builtin name for this in Clang and GCC quite a while back, but haven't actually got around to implementing it in Clang yet. You should use `__has_builtin` to detect the existence of this builtin in Clang. In GCC, I believe this is available iff `__GNUC__` is 7 or greater.


https://reviews.llvm.org/D40144





More information about the cfe-commits mailing list