<html>
<head>
<base href="http://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 --- - Regression: Clang fails to compile lambda with by-ref capture of incomplete type"
href="http://llvm.org/bugs/show_bug.cgi?id=18343">18343</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Regression: Clang fails to compile lambda with by-ref capture of incomplete type
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jonathan.sauer@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following program fails to compile with clang r198208, while it compiles
with clang r197376:
struct Foo;
static void bar(Foo& foo)
{
[&]() {
foo;
};
}
This results in:
% ~/LLVM/build/Release+Asserts/bin/clang++ -c -std=c++11 clang.cpp
clang.cpp:6:9: error: by-copy capture of variable 'foo' with incomplete type
'Foo'
foo;
^
clang.cpp:1:8: note: forward declaration of 'Foo'
struct Foo;
^
[2 warnings about unused expression result]
2 warnings and 1 error generated.
This seems to have been introduced in r197623[*] with a fix to require a
by-copy capture to have a complete type. I don't think completeness is
necessary for by-ref captures.
[*]
<<a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131216/095880.html">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131216/095880.html</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>