Remove constexpr support for std::apply because it introduces regressions.

llvm-svn: 235274
This commit is contained in:
Eric Fiselier 2015-04-19 15:32:52 +00:00
parent 553af2a34c
commit 445d718807
5 changed files with 19 additions and 11 deletions

View File

@ -364,7 +364,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
template <class _Fp, class _A0, class ..._Args,
class>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _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,
class>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _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,
class>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
-> decltype(_VSTD::forward<_A0>(__a0).*__f)
@ -396,7 +396,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
template <class _Fp, class _A0,
class>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
@ -407,7 +407,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
// bullet 5
template <class _Fp, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& ...__args)
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))

View File

@ -56,7 +56,7 @@ _LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value;
#endif
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,
integer_sequence<size_t, _Id...>) {
return _VSTD::__invoke(

View File

@ -3448,7 +3448,7 @@ template <class _Fp, class _A0, class ..._Args,
typename remove_reference<_A0>::type>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _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
>::type
>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _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
>::type
>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
@ -3489,7 +3489,7 @@ template <class _Fp, class _A0,
typename remove_reference<_A0>::type>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
@ -3497,7 +3497,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
// bullet 5
template <class _Fp, class ..._Args>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& ...__args)
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));

View File

@ -9,6 +9,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>
// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)

View File

@ -32,6 +32,8 @@ namespace ex = std::experimental;
int main()
{
// TODO(ericwf): Re-enable constexpr support
/*
{
constexpr func_obj f;
constexpr std::tuple<> tp;
@ -39,6 +41,7 @@ int main()
static_assert(1 == ex::apply(static_cast<func_obj const &>(f), tp), "");
static_assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp), "");
}
*/
{
func_obj f;
std::tuple<> tp;