[llvm-bugs] [Bug 40302] Fails to deduce template type for repeated argument of the same type

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 14 12:23:18 PST 2019


Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Richard Smith <richard-llvm at metafoo.co.uk> ---
That may be true, but this isn't the right forum to discuss that. You can force
a conversion from a non-capturing lambda to a function pointer / function
lvalue in a number of ways, including unary prefix operator + and operator *,
so there are at least simple workarounds:

auto fn = someBool ? +[](){return 1;} : +[](){return 2;}; // ok

Clang is following the standard C++ rules here, so I'm closing this bug. If you
want to discuss those rules further, this is not the appropriate place;
std-discussion and stackoverflow would be better forums.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190114/f40bc484/attachment.html>

More information about the llvm-bugs mailing list