fork download
  1. struct A{};
  2.  
  3. void f(A&)
  4. {
  5.  
  6. }
  7. A a()
  8. {
  9. return A();
  10. }
  11.  
  12. int main()
  13. {
  14. f(a());
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:10: error: invalid initialization of non-const reference of type ‘A&’ from an rvalue of type ‘A’
prog.cpp:3:6: error: in passing argument 1 of ‘void f(A&)’
stdout
Standard output is empty