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});
gcc gives an error on the specified line (I tried both gcc 4.5 and the experimental build of gcc 4.6)
Is this invalid C ++ 11 or is the gcc 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
source share