struct foo {}; struct bar { bar(foo& f) : f{f} {} foo& f; }; int main() { foo f; bar b{f}; }
Standard input is empty
prog.cpp: In constructor 'bar::bar(foo&)': prog.cpp:7:14: error: invalid initialization of non-const reference of type 'foo&' from an rvalue of type '<brace-enclosed initializer list>'
Standard output is empty