#include <iostream>

struct Foo; // forward declaration only

template<typename T>
void Bar(T*, typename T::foo = 0) {
    std::cout << __PRETTY_FUNCTION__ << std::endl;
}

void Bar(void*) {
    std::cout << __PRETTY_FUNCTION__ << std::endl;
}

int main() {
    Bar((Foo*)NULL);
}
