This patch is an alternate approach to D9730
std::experimental::apply requires a constexpr implementation of INVOKE(...). Simply marking the current implementation of invoke as constexpr will break existing code due to CWG issue #1581. For this reason we should add a separate function called invoke_constexpr to be used where constexpr is required.
This patch adds a __invoke_constexpr function that mirrors __invoke.
I chose not to generate invoke functions using macros because of the amount of code that would have to be within a macro block. It also is likely to yield bad error messages.
This patch also re-enables constexpr support for std::experimental::apply.
Also See:
https://llvm.org/bugs/show_bug.cgi?id=23141
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1581