[libcxx] r263310 - Disable CFI checks in std::addressof.

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 15:50:57 PST 2016


Author: eugenis
Date: Fri Mar 11 17:50:57 2016
New Revision: 263310

URL: http://llvm.org/viewvc/llvm-project?rev=263310&view=rev
Log:
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.

Modified:
    libcxx/trunk/include/type_traits

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=263310&r1=263309&r2=263310&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri Mar 11 17:50:57 2016
@@ -399,7 +399,7 @@ template <bool _Bp, class _Tp = void> us
 // addressof
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {




More information about the cfe-commits mailing list