<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 --- - can't cast an auto lambda with implicit void return type to function pointer"
href="https://llvm.org/bugs/show_bug.cgi?id=25989">25989</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>can't cast an auto lambda with implicit void return type to function pointer
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>blastrock@free.fr
</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>Hi,
The following code used to compile with clang 3.6. It also works with VC++ 2015
and g++ 5.2.
void (*f)(int) = [](auto){};
On clang 3.7, it fails with the following error:
test.cpp:3:10: error: no viable conversion from '(lambda at test.cpp:3:20)'
to 'void (*)(int)'
void (*f)(int) = [](auto){};
test.cpp:3:20: note: candidate template ignored: could not match 'void'
against 'void'
void (*f)(int) = [](auto){};
This code however does compile even with clang 3.7:
void (*f)(int) = [](auto) -> auto {};</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>