What is wrong with the following C++11 code:
struct S
{
int a;
float b;
};
struct T
{
T(S s) {}
};
int main()
{
T t(S{1, 0.1}); // ERROR HERE
}
gcc gives an error at the indicated line (I tried both gcc 4.5 and an experimental build of gcc 4.6)
Is this not valid C++11, or is gcc's implementation incomplete?
EDIT: Here are the compiler errors:
test.cpp: In function int main():
test.cpp:14:10: error: expected ) before { token
test.cpp:14:10: error: a function-definition is not allowed here before { token
test.cpp:14:18: error: expected primary-expression before ) token
test.cpp:14:18: error: expected ; before ) token