From 445d718807237ab6abc5c93045681115a4d7e917 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 19 Apr 2015 15:32:52 +0000 Subject: [PATCH] Remove constexpr support for std::apply because it introduces regressions. llvm-svn: 235274 --- libcxx/include/__functional_base | 10 +++++----- libcxx/include/experimental/tuple | 2 +- libcxx/include/type_traits | 10 +++++----- .../tuple/tuple.apply/constexpr_types.pass.cpp | 5 +++++ .../tuple/tuple.apply/ref_qualifiers.pass.cpp | 3 +++ 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base index 64bc93116f08..09424bc025a9 100644 --- a/libcxx/include/__functional_base +++ b/libcxx/include/__functional_base @@ -364,7 +364,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> template -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 -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 -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 -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 -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)...)) diff --git a/libcxx/include/experimental/tuple b/libcxx/include/experimental/tuple index 34133b2d1500..50d1e0555bc4 100644 --- a/libcxx/include/experimental/tuple +++ b/libcxx/include/experimental/tuple @@ -56,7 +56,7 @@ _LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value; #endif template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +inline _LIBCPP_INLINE_VISIBILITY decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t, integer_sequence) { return _VSTD::__invoke( diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 1b2c63e33b9e..49eecacca017 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -3448,7 +3448,7 @@ template ::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 ::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 ::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 ::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 -_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)...)); diff --git a/libcxx/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp b/libcxx/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp index 5b8a8f09d1ee..2d700486f26b 100644 --- a/libcxx/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp +++ b/libcxx/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp @@ -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: * + // // template constexpr decltype(auto) apply(F &&, T &&) diff --git a/libcxx/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp b/libcxx/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp index 64ee66e6dec4..3cf259f531c9 100644 --- a/libcxx/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp +++ b/libcxx/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp @@ -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(f), tp), ""); static_assert(2 == ex::apply(static_cast(f), tp), ""); } +*/ { func_obj f; std::tuple<> tp;