This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix PR 23589: std::function doesn't recognize null pointer to varargs function
AbandonedPublic

Authored by EricWF on May 20 2015, 12:40 AM.

Details

Reviewers
mclow.lists
Summary

__not_null is missing overloads for cv and ref qualified member functions as well as functions that have varargs. This patch adds these overloads.

see https://llvm.org/bugs/show_bug.cgi?id=23589.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 26126.May 20 2015, 12:40 AM
EricWF retitled this revision from to [libcxx] Fix PR 23589: std::function doesn't recognize null pointer to varargs function.
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: Unknown Object (MLST).
Potatoswatter added a subscriber: Potatoswatter.EditedMay 20 2015, 1:28 AM

A lot of work can be saved by ignoring the function signature.

template<class _R2, class _Cp>
static bool not_null(_R2 _Cp::* p) {return __p;}

EricWF updated this revision to Diff 26128.May 20 2015, 1:40 AM

Flush out tests.

EricWF updated this revision to Diff 26129.May 20 2015, 1:56 AM

Use Davids suggestion to reduce code duplication. I didn't know that would work :-)

Withdrawing this patch. I have a large number of __invoke tests to check in before I start fixing this.

EricWF abandoned this revision.Jun 1 2015, 10:29 AM