fork download
  1. #include <iostream>
  2.  
  3. class ra{
  4. public:
  5.  
  6. };
  7.  
  8.  
  9. ra hey(){
  10. ra io;
  11. return io;
  12. }
  13.  
  14. void e(ra& i){
  15. std::cout << "on" << std::endl;
  16. }
  17. int main() {
  18. e(ra());
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:18:8: error: invalid initialization of non-const reference of type ‘ra&’ from an rvalue of type ‘ra’
prog.cpp:14:6: error: in passing argument 1 of ‘void e(ra&)’
stdout

Standard output is empty