<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 - ICE explicit calling a caputered lambda expression with a paramater pack"
href="https://bugs.llvm.org/show_bug.cgi?id=50246">50246</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE explicit calling a caputered lambda expression with a paramater pack
</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>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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Peter.Georg@physik.uni-regensburg.de
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=24835" name="attach_24835" title="Crash backtrace">attachment 24835</a> <a href="attachment.cgi?id=24835&action=edit" title="Crash backtrace">[details]</a></span>
Crash backtrace
See reduced test-case on Compiler Explorer: <a href="https://godbolt.org/z/G4qT3sEf9">https://godbolt.org/z/G4qT3sEf9</a>
According to Compiler Explorer all clang versions (supporting the required
C++11/14 features) are affected by this bug.
clang frontend crashes when explicitly calling a captured lambda expression's
operator() using a parameter pack as arguments. The issue has been observed in
a larger code base in a more complex scenario using the familiar template
syntax for generic lambdas introduced in C++20.
Luckily I've been able to reduce the code to just a few meaning-less lines of
code still showing the same compiler error. While I have been able to rewrite
it using only C++11, the attached reduced code is written using C++14 features.
It just seems easier to understand and removes probably unrelated code.
Code to reproduce:
int main() {
{
auto const f = [](auto...) {};
[f](auto const... ops) { f.operator()(ops...); }();
}
}
My tests have shown that in line 4 of the code to reproduce the bug will only
show if all following three conditions are met:
1. The lambda expression f is captured. I.e. not defined within the other
unnamed lambda expression.
2. The lambda expression f is called via explicitly specifying .operator()
3. A parameter pack expansion is used as the arguments for calling the lambda
expression f. The size of the parameter pack does not matter, may be empty.
Attachements:
Crash backtrace, preprocessed source(s), and run script produced on local
machine with clang 11.</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>