#include <iostream> using namespace std; template<typename T> void foo (T& a) { } int main() { foo(3); return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:10:7: error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’ foo(3); ^ prog.cpp:5:6: error: in passing argument 1 of ‘void foo(T&) [with T = int]’ void foo (T& a) ^
Standard output is empty