commit | ffc63a8f8ca7c2ccc525c876aa9ba9031176f782 | [log] [tgz] |
---|---|---|
author | Faisal Vali <faisalv@yahoo.com> | Tue Oct 08 04:15:04 2013 +0000 |
committer | Faisal Vali <faisalv@yahoo.com> | Tue Oct 08 04:15:04 2013 +0000 |
tree | 22f82d914a52582dbba9e58ad67f8f91154684bd | |
parent | d1a32c328bce903fb1b17fc8147b646be818298e [diff] |
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192166 91177308-0d34-0410-b5e6-96231b3b80d8