diff options
author | Faisal Vali <faisalv@yahoo.com> | 2013-10-08 04:15:04 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2013-10-08 04:15:04 +0000 |
commit | d2598e97a4ac39610111f7315220187f1c55c049 (patch) | |
tree | a5a68634c94def430e11e5e965b18bdbfa5cf165 /llvm/utils/TableGen/X86RecognizableInstr.cpp | |
parent | 7deb970d66788940c647e3f3e6a5446c85ef6d9b (diff) | |
download | bcm5719-llvm-d2598e97a4ac39610111f7315220187f1c55c049.tar.gz bcm5719-llvm-d2598e97a4ac39610111f7315220187f1c55c049.zip |
Fix linkage calculation of auto member functions returning lambdas
As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ
we should allow:
template<typename S>
struct A {
template<typename T> static auto default_lambda() {
return [](const T&) { return 42; };
}
template<class U = decltype(default_lambda<S>())>
U func(U u = default_lambda<S>()) { return u; }
};
int run2 = A<double>{}.func()(3.14);
int run3 = A<char>{}.func()('a');
This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.
Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.
llvm-svn: 192166
Diffstat (limited to 'llvm/utils/TableGen/X86RecognizableInstr.cpp')
0 files changed, 0 insertions, 0 deletions