http://llvm.org/bugs/show_bug.cgi?id=19339
Bug ID: 19339
Summary: generalized lambda capture in uniform initialization
failed to compile
Product: clang
Version: trunk
Hardware: PC
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++1y
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
#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)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs