#include <cstdint> typedef uint8_t testtype; enum testenum : uint8_t { }; void foo(uint8_t& v) {} int main() { testtype bar; foo(bar); testenum baz; foo(baz); return 0; }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:15:9: error: invalid initialization of non-const reference of type 'uint8_t& {aka unsigned char&}' from an rvalue of type 'uint8_t {aka unsigned char}' foo(baz); ^ prog.cpp:8:6: note: initializing argument 1 of 'void foo(uint8_t&)' void foo(uint8_t& v) {} ^
Standard output is empty