<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Clang doesn't require references to be listed in lambda capture"
href="https://bugs.llvm.org/show_bug.cgi?id=34865">bug 34865</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Clang doesn't require references to be listed in lambda capture"
href="https://bugs.llvm.org/show_bug.cgi?id=34865#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Clang doesn't require references to be listed in lambda capture"
href="https://bugs.llvm.org/show_bug.cgi?id=34865">bug 34865</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>Reopening: while the warning may be correct, the location if the diagnostic is
not quite right. We should instead be pointing at the point of use:
test2.cpp:4:29: warning: lambda capture 'varRef' is not required to be captured
for this use [-Wunused-lambda-capture]
return [&varRef]{return varRef;}();
^
... and it'd be a good idea to add a note, something like:
test2.cpp:3:29: note: 'varRef' is a reference bound to a constant expression
evaluating to 'var'; that lvalue will be used in place of 'varRef' in the
lambda body
int& varRef = var;
^</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>