From 8948264ed7a7dc685246b1c30ded2d2a630c1860 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 17 Apr 2017 22:32:02 +0000 Subject: [PATCH] Work around GCC 4.9 bug regarding default initialization of const variables llvm-svn: 300510 --- libcxx/include/memory | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libcxx/include/memory b/libcxx/include/memory index 87484a1..3fc0e5a1 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -2079,17 +2079,12 @@ struct __compressed_pair_elem { typedef const _Tp& const_reference; #ifndef _LIBCPP_CXX03_LANG - template , _Dummy>::value - >::type - > - _LIBCPP_CONSTEXPR __compressed_pair_elem() - _NOEXCEPT_(is_nothrow_default_constructible<_Tp>::value) - : __value_() {} + constexpr __compressed_pair_elem() : __value_() {} template ::value>::type> - _LIBCPP_CONSTEXPR explicit + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_(_VSTD::forward<_Up>(__u)){}; @@ -2118,11 +2113,12 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { typedef _Tp __value_type; #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_CONSTEXPR __compressed_pair_elem() = default; + constexpr __compressed_pair_elem() = default; template ::value>::type> - _LIBCPP_CONSTEXPR explicit + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_type(_VSTD::forward<_Up>(__u)){}; @@ -2161,8 +2157,14 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>, public: #ifndef _LIBCPP_CXX03_LANG + template , _Dummy>::value && + __dependent_type, _Dummy>::value + >::type + > _LIBCPP_INLINE_VISIBILITY - __compressed_pair() = default; + constexpr __compressed_pair() {} template ::type, __compressed_pair>::value, -- 2.7.4