[PATCH] D18107: Disable CFI checks in std::addressof.

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


eugenis created this revision.
eugenis added a reviewer: EricWF.
eugenis added a subscriber: cfe-commits.
eugenis set the repository for this revision to rL LLVM.

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.


Repository:
  rL LLVM

http://reviews.llvm.org/D18107

Files:
  include/type_traits

Index: include/type_traits
===================================================================
--- include/type_traits
+++ include/type_traits
@@ -399,7 +399,7 @@
 // addressof
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18107.50495.patch
Type: text/x-patch
Size: 324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160311/a2f7af18/attachment.bin>


More information about the cfe-commits mailing list