
This patch does a couple of things to get __invoke working for free-functions and call objects. 1. Turn all uses of declval<Tp>() into declval<Tp&>(). The C++03 __invoke only supports lvalues but it will be used when the compiler supports rvalue references but not variadic templates. This change makes sure we don't generate an rvalue. 2. Call objects for bullet 5 are now passed by reference and not value. Copying the functor is incorrect. It will fail to compile for non-copyable functors and it will discard cv-qualifiers on the call object, possibly leading to the wrong function being called. I suspect that the reason the call object was originally taken by value was to support temporary call objects. However __invoke is only used internally and it is never given a temporary. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243368 91177308-0d34-0410-b5e6-96231b3b80d8
Description
No description provided
Languages
C++
98.1%
HTML
1.2%
Python
0.4%
CMake
0.2%