When I try to compile this code
// void foobar(int); template struct Foo { void bar(T t) { foobar(t); }; }; void foobar(int); template clas
Looks correct to me. While overload resolution is done only in phase 2, in phase 1 you already have to know that foobar(t) is a function call expression. If foobar names a type, t wouldn't even be a dependent name.
foobar(t)
foobar
t