<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Type deduction and capture in lambda fails if type is defined far away (?) from the point of deduction"
href="https://bugs.llvm.org/show_bug.cgi?id=45538">45538</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Type deduction and capture in lambda fails if type is defined far away (?) from the point of deduction
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sbsbalint14@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=23355" name="attach_23355" title="minimal example and the install script for LLVM">attachment 23355</a> <a href="attachment.cgi?id=23355&action=edit" title="minimal example and the install script for LLVM">[details]</a></span>
minimal example and the install script for LLVM
The problem presented itself while using the boost unit test framework. It
seems like that it is both a type deduction and a lambda capture issue, which
only happens if the type deduction has to be carried out through many layers of
indirection. Therefore, unfortunately, I couldn't eliminate the boost unit test
framework from the minimal example.
The error is:
test_true_minimal.cpp:20:30: error: variable 'j' cannot be implicitly captured
in a lambda with no capture-default specified
g([=](const test_class<j, 3> item) {});
I am using the newest commit from the release/10.x branch
(edbe962459da6e3b7b4168118f93a77847b54e02) I built clang locally, with the
build script install_llvm.sh (attached) inside an archlinux singularity
container. boost has been installed from the arch repos, version 1.72.
I read the guide for regarding bug reports, but I am not sure in this
particular case which files are relevant. Please let me know if you need any
further input.
The original discussion on GitHub might also be useful:
<a href="https://github.com/illuhad/hipSYCL/issues/231">https://github.com/illuhad/hipSYCL/issues/231</a></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>