From: Alex Lorenz Date: Thu, 9 Nov 2017 17:54:49 +0000 (+0000) Subject: Add _LIBCPP_INLINE_VISIBILITY to __compressed_pair_elem members X-Git-Tag: llvmorg-6.0.0-rc1~3768 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dae972c660aac339648858c712d106056f1bb4c;p=platform%2Fupstream%2Fllvm.git Add _LIBCPP_INLINE_VISIBILITY to __compressed_pair_elem members The commit r300140 changed the implementation of compressed_pair, but didn't add _LIBCPP_INLINE_VISIBILITY to the constructors and get members of the compressed_pair_elem class. This patch adds the visibility annotation. I didn't find a way to test this change with libc++ regression tests. rdar://35352579 Differential Revision: https://reviews.llvm.org/D39751 llvm-svn: 317816 --- diff --git a/libcxx/include/memory b/libcxx/include/memory index 351529a..888ce69 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -2040,11 +2040,12 @@ struct __compressed_pair_elem { typedef const _Tp& const_reference; #ifndef _LIBCPP_CXX03_LANG - constexpr __compressed_pair_elem() : __value_() {} + _LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() : __value_() {} template ::type>::value >::type> + _LIBCPP_INLINE_VISIBILITY constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_(_VSTD::forward<_Up>(__u)){}; @@ -2055,11 +2056,13 @@ struct __compressed_pair_elem { __tuple_indices<_Indexes...>) : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {} #else - __compressed_pair_elem() : __value_() {} + _LIBCPP_INLINE_VISIBILITY __compressed_pair_elem() : __value_() {} + _LIBCPP_INLINE_VISIBILITY __compressed_pair_elem(_ParamT __p) : __value_(std::forward<_ParamT>(__p)) {} #endif - reference __get() _NOEXCEPT { return __value_; } + _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; } + _LIBCPP_INLINE_VISIBILITY const_reference __get() const _NOEXCEPT { return __value_; } private: @@ -2074,11 +2077,12 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { typedef _Tp __value_type; #ifndef _LIBCPP_CXX03_LANG - constexpr __compressed_pair_elem() = default; + _LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() = default; template ::type>::value >::type> + _LIBCPP_INLINE_VISIBILITY constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_type(_VSTD::forward<_Up>(__u)){}; @@ -2089,12 +2093,14 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { __tuple_indices<_Indexes...>) : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {} #else - __compressed_pair_elem() : __value_type() {} + _LIBCPP_INLINE_VISIBILITY __compressed_pair_elem() : __value_type() {} + _LIBCPP_INLINE_VISIBILITY __compressed_pair_elem(_ParamT __p) : __value_type(std::forward<_ParamT>(__p)) {} #endif - reference __get() _NOEXCEPT { return *this; } + _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; } + _LIBCPP_INLINE_VISIBILITY const_reference __get() const _NOEXCEPT { return *this; } };