<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Regression for assignment of generic zero-capture lambda expressions"
href="https://llvm.org/bugs/show_bug.cgi?id=26725">26725</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Regression for assignment of generic zero-capture lambda expressions
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>neil.semmel@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>From clang 3.7 and onward, the following code will not compile:
#include <iostream>
int main( void ) {
void (*func)(int) = [](auto a){ std::cout << a << std::endl; };
func( 1 );
}
and errors with
test.cpp:3:12: error: no viable conversion from '(lambda at test.cpp:3:25)' to
'void (*)(int)'
void (*func)(int) = [](auto a){ std::cout << a << std::endl; };
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:3:25: note: candidate template ignored: could not match 'void' against
'void'
void (*func)(int) = [](auto a){ std::cout << a << std::endl; };
^
2 errors generated.
On clang 3.6 this compiles and executes as expected.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>