fork download
  1. struct { int a, b; } f(int x, int y) // OK
  2. {
  3. return { x, y };
  4. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: new types may not be defined in a return type
 struct { int a, b; } f(int x, int y) // OK
 ^
prog.cpp:1:1: note: (perhaps a semicolon is missing after the definition of ‘<anonymous struct>’)
prog.cpp:1:36: error: anonymous type with no linkage used to declare function ‘<anonymous struct> f(int, int)’ with linkage [-fpermissive]
 struct { int a, b; } f(int x, int y) // OK
                                    ^
prog.cpp: In function ‘<anonymous struct> f(int, int)’:
prog.cpp:3:5: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
     return { x, y };
     ^
stdout

Standard output is empty