Disable CFI checks in std::addressof.

std::addressof may be used on a storage of an object before the start
of its lifetime (see std::allocate_shared for example). CFI flags the
C-style cast as invalid in that case.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@263310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evgeniy Stepanov
2016-03-11 23:50:57 +00:00
parent fadd1db573
commit 2fe62cded3

View File

@@ -399,7 +399,7 @@ template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp
// addressof // addressof
template <class _Tp> template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
_Tp* _Tp*
addressof(_Tp& __x) _NOEXCEPT addressof(_Tp& __x) _NOEXCEPT
{ {