<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 --- - generalized lambda capture in uniform initialization failed to compile"
href="http://llvm.org/bugs/show_bug.cgi?id=19339">19339</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>generalized lambda capture in uniform initialization failed to compile
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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++1y
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>xlchen1291@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <utility>
#include <vector>
struct Foo {
template <class T>
Foo(T) {}
};
void bar()
{
std::vector<int> vec;
auto func = [vec{std::move(vec)}] () { };
Foo f1 { func}; // compile
Foo f2 { [vec] () { } }; // compile
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
}
int main() {
}
----------------------------
clang++ -std=c++1y -O2 -Wall -pedantic -pthread main.cpp
main.cpp:15:18: error: expected ']'
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
^
main.cpp:15:14: note: to match this '['
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
^
main.cpp:15:36: warning: use of GNU 'missing =' extension in designator
[-Wgnu-designator]
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
^
=
main.cpp:15:37: error: expected expression
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
^
main.cpp:15:15: error: integral constant expression must have integral or
unscoped enumeration type, not 'std::vector<int>'
Foo f3 { [vec{std::move(vec)}] () {} }; // failed to compile
^~~
1 warning and 3 errors generated.
---------------
clang version 3.5 (trunk 198621)</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>