forked from OSchip/llvm-project
Fix the default constructibility of __compressed_pair.
This patch fixes a bug where the =default default ctor for __compressed_pair was incorrect for const qualified types. llvm-svn: 300152
This commit is contained in:
parent
29a0f0db9e
commit
4104cf8257
|
@ -2079,7 +2079,13 @@ struct __compressed_pair_elem {
|
|||
typedef const _Tp& const_reference;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
__compressed_pair_elem() = default;
|
||||
template <bool _Dummy = true, class = typename enable_if<
|
||||
__dependent_type<is_default_constructible<_Tp>, _Dummy>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_CONSTEXPR __compressed_pair_elem()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Tp>::value)
|
||||
: __value_() {}
|
||||
|
||||
template <class _Up, class = typename enable_if<
|
||||
!is_same<__compressed_pair_elem, _Up>::value>::type>
|
||||
|
@ -2112,7 +2118,7 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
|
|||
typedef _Tp __value_type;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
__compressed_pair_elem() = default;
|
||||
_LIBCPP_CONSTEXPR __compressed_pair_elem() = default;
|
||||
|
||||
template <class _Up, class = typename enable_if<
|
||||
!is_same<__compressed_pair_elem, _Up>::value>::type>
|
||||
|
|
Loading…
Reference in New Issue