<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Binary size exploding when using a lambda in a template with multiple parameters"
href="https://bugs.llvm.org/show_bug.cgi?id=40512">bug 40512</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;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Binary size exploding when using a lambda in a template with multiple parameters"
href="https://bugs.llvm.org/show_bug.cgi?id=40512#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Binary size exploding when using a lambda in a template with multiple parameters"
href="https://bugs.llvm.org/show_bug.cgi?id=40512">bug 40512</a>
from <span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span></b>
<pre>(In reply to A. Joël Lamotte from <a href="show_bug.cgi?id=40512#c5">comment #5</a>)
<span class="quote">> Thank you very much for this clarification, it helps a lot.
> Not sure what to do about it. Probably that would need some change to the
> standard to be fixed, or an epic effort from compiler impls.</span >
Yep, pretty much.
For the original code, you've got the external function which is probably the
simplest thing to do. (you could outline more of the code to reduce duplication
further - incnluding the thread construction and usage:
template<typename A>
void do_f(A a) {
std::thread t{
[a] {
if (a % 2 == A(0)) {
std::cout << "even: " << a << '\n';
} else {
std::cout << "odd: " << a << '\n';
}
}
};
t.detach();
}
...
auto f() const {
do_f(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>