This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Add __invoke_constexpr functions. Try 2.
AbandonedPublic

Authored by EricWF on Jul 18 2015, 10:56 AM.

Details

Reviewers
mclow.lists
Summary

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

Diff Detail

Event Timeline

EricWF updated this revision to Diff 30083.Jul 18 2015, 10:56 AM
EricWF retitled this revision from to [libcxx] Add __invoke_constexpr functions. Try 2..
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.

@mclow.lists: I would like to move ahead with this patch. The INVOKE meta-programming support will help me re-implement the C++03 __invoke.

EricWF abandoned this revision.Apr 19 2016, 7:16 PM

Another solution has been committed.