Disable CFI checks in std::addressof.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 11 Mar 2016 23:50:57 +0000 (23:50 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 11 Mar 2016 23:50:57 +0000 (23:50 +0000)
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.

llvm-svn: 263310

libcxx/include/type_traits

index 33124d2..47f9334 100644 (file)
@@ -399,7 +399,7 @@ template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp
 // addressof
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {