prog.cpp: In function 'int main()':
prog.cpp:11:8: error: invalid initialization of non-const reference of type 'X&' from an rvalue of type 'X'
g1(f());
^
prog.cpp:6:6: note: in passing argument 1 of 'void g1(X&)'
void g1(X&) {} // Pass by non-const reference
^