Remove constexpr support for std::apply because it introduces regressions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@235274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e9d030687d
commit
c254b36c29
@ -364,7 +364,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
|
|||||||
|
|
||||||
template <class _Fp, class _A0, class ..._Args,
|
template <class _Fp, class _A0, class ..._Args,
|
||||||
class>
|
class>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
|
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||||
@ -374,7 +374,7 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
|||||||
|
|
||||||
template <class _Fp, class _A0, class ..._Args,
|
template <class _Fp, class _A0, class ..._Args,
|
||||||
class>
|
class>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
|
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||||
@ -386,7 +386,7 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
|||||||
|
|
||||||
template <class _Fp, class _A0,
|
template <class _Fp, class _A0,
|
||||||
class>
|
class>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f)
|
-> decltype(_VSTD::forward<_A0>(__a0).*__f)
|
||||||
@ -396,7 +396,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
|
|||||||
|
|
||||||
template <class _Fp, class _A0,
|
template <class _Fp, class _A0,
|
||||||
class>
|
class>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
|
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
|
||||||
@ -407,7 +407,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
|
|||||||
// bullet 5
|
// bullet 5
|
||||||
|
|
||||||
template <class _Fp, class ..._Args>
|
template <class _Fp, class ..._Args>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _Args&& ...__args)
|
__invoke(_Fp&& __f, _Args&& ...__args)
|
||||||
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
|
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
|
||||||
|
@ -56,7 +56,7 @@ _LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _Fn, class _Tuple, size_t ..._Id>
|
template <class _Fn, class _Tuple, size_t ..._Id>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t,
|
decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t,
|
||||||
integer_sequence<size_t, _Id...>) {
|
integer_sequence<size_t, _Id...>) {
|
||||||
return _VSTD::__invoke(
|
return _VSTD::__invoke(
|
||||||
|
@ -3448,7 +3448,7 @@ template <class _Fp, class _A0, class ..._Args,
|
|||||||
typename remove_reference<_A0>::type>::value
|
typename remove_reference<_A0>::type>::value
|
||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
@ -3461,7 +3461,7 @@ template <class _Fp, class _A0, class ..._Args,
|
|||||||
typename remove_reference<_A0>::type>::value
|
typename remove_reference<_A0>::type>::value
|
||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
@ -3476,7 +3476,7 @@ template <class _Fp, class _A0,
|
|||||||
typename remove_reference<_A0>::type>::value
|
typename remove_reference<_A0>::type>::value
|
||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
|
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
|
||||||
@ -3489,7 +3489,7 @@ template <class _Fp, class _A0,
|
|||||||
typename remove_reference<_A0>::type>::value
|
typename remove_reference<_A0>::type>::value
|
||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
|
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
|
||||||
@ -3497,7 +3497,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
|
|||||||
// bullet 5
|
// bullet 5
|
||||||
|
|
||||||
template <class _Fp, class ..._Args>
|
template <class _Fp, class ..._Args>
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _Args&& ...__args)
|
__invoke(_Fp&& __f, _Args&& ...__args)
|
||||||
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
|
// TODO(ericwf)
|
||||||
|
// constexpr support temporarily reverted due to bug:
|
||||||
|
// https://llvm.org/bugs/show_bug.cgi?id=23141
|
||||||
|
// XFAIL: *
|
||||||
|
|
||||||
// <experimental/tuple>
|
// <experimental/tuple>
|
||||||
|
|
||||||
// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
|
// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
|
||||||
|
@ -32,6 +32,8 @@ namespace ex = std::experimental;
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
// TODO(ericwf): Re-enable constexpr support
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
constexpr func_obj f;
|
constexpr func_obj f;
|
||||||
constexpr std::tuple<> tp;
|
constexpr std::tuple<> tp;
|
||||||
@ -39,6 +41,7 @@ int main()
|
|||||||
static_assert(1 == ex::apply(static_cast<func_obj const &>(f), tp), "");
|
static_assert(1 == ex::apply(static_cast<func_obj const &>(f), tp), "");
|
||||||
static_assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp), "");
|
static_assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp), "");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
func_obj f;
|
func_obj f;
|
||||||
std::tuple<> tp;
|
std::tuple<> tp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user