prog.cpp: In instantiation of ‘void bar(T) [with T = Z::X]’:
prog.cpp:24:7: required from here
prog.cpp:12:7: error: ‘foo’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
foo(t);
^
prog.cpp:16:6: note: ‘void foo(Z::X)’ declared here, later in the translation unit
void foo(Z::X x)
^