addr-of-overloaded-function-casting.cpp [plain text]
void g();
void f(); void f(int);
template<class T> void t(T); template<class T> void t(T*);
template<class T> void u(T);
int main()
{
{ bool b = (void (&)(char))f; } { bool b = (void (*)(char))f; }
{ bool b = (void (&)(int))f; } { bool b = (void (*)(int))f; }
{ bool b = static_cast<void (&)(char)>(f); } { bool b = static_cast<void (*)(char)>(f); }
{ bool b = static_cast<void (&)(int)>(f); } { bool b = static_cast<void (*)(int)>(f); }
{ bool b = reinterpret_cast<void (&)(char)>(f); } { bool b = reinterpret_cast<void (*)(char)>(f); }
{ bool b = reinterpret_cast<void (*)(char)>(g); } { bool b = static_cast<void (*)(char)>(g); }
{ bool b = reinterpret_cast<void (&)(int)>(f); } { bool b = reinterpret_cast<void (*)(int)>(f); }
{ bool b = (int (&)(char))t; } { bool b = (int (*)(char))t; }
{ bool b = (void (&)(int))t; } { bool b = (void (*)(int))t; }
{ bool b = static_cast<void (&)(char)>(t); } { bool b = static_cast<void (*)(char)>(t); }
{ bool b = static_cast<void (&)(int)>(t); } { bool b = static_cast<void (*)(int)>(t); }
{ bool b = reinterpret_cast<void (&)(char)>(t); } { bool b = reinterpret_cast<void (*)(char)>(t); }
{ bool b = reinterpret_cast<int (*)(char)>(g); } { bool b = static_cast<int (*)(char)>(t); } { bool b = static_cast<int (&)(char)>(t); }
{ bool b = static_cast<void (&)(char)>(f); } }