From 2fe62cded3a7ab806a1d17f6aed34bbe22a20acf Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Fri, 11 Mar 2016 23:50:57 +0000 Subject: [PATCH] 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 --- include/type_traits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/type_traits b/include/type_traits index 33124d2e2..47f9334a5 100644 --- a/include/type_traits +++ b/include/type_traits @@ -399,7 +399,7 @@ template using enable_if_t = typename enable_if<_Bp // addressof template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY _Tp* addressof(_Tp& __x) _NOEXCEPT {