1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 void f(); // expected-note 9{{candidate function}}
5 void f(int); // expected-note 9{{candidate function}}
7 template<class T> void t(T); // expected-note 6{{candidate function}}
8 template<class T> void t(T*); // expected-note 6{{candidate function}}
10 template<class T> void u(T);
14 { bool b = (void (&)(char))f; } // expected-error{{does not match required type}}
15 { bool b = (void (*)(char))f; } // expected-error{{does not match required type}}
17 { bool b = (void (&)(int))f; } //ok
18 { bool b = (void (*)(int))f; } //ok
20 { bool b = static_cast<void (&)(char)>(f); } // expected-error{{does not match}}
21 { bool b = static_cast<void (*)(char)>(f); } // expected-error{{address of overloaded function}}
23 { bool b = static_cast<void (&)(int)>(f); } //ok
24 { bool b = static_cast<void (*)(int)>(f); } //ok
27 { bool b = reinterpret_cast<void (&)(char)>(f); } // expected-error{{cannot resolve}}
28 { bool b = reinterpret_cast<void (*)(char)>(f); } // expected-error{{cannot resolve}}
30 { bool b = reinterpret_cast<void (*)(char)>(g); } //ok
31 { bool b = static_cast<void (*)(char)>(g); } // expected-error{{not allowed}}
33 { bool b = reinterpret_cast<void (&)(int)>(f); } // expected-error{{cannot resolve}}
34 { bool b = reinterpret_cast<void (*)(int)>(f); } // expected-error{{cannot resolve}}
36 { bool b = (int (&)(char))t; } // expected-error{{does not match}}
37 { bool b = (int (*)(char))t; } // expected-error{{does not match}}
39 { bool b = (void (&)(int))t; } //ok
40 { bool b = (void (*)(int))t; } //ok
42 { bool b = static_cast<void (&)(char)>(t); } //ok
43 { bool b = static_cast<void (*)(char)>(t); } //ok
45 { bool b = static_cast<void (&)(int)>(t); } //ok
46 { bool b = static_cast<void (*)(int)>(t); } //ok
49 { bool b = reinterpret_cast<void (&)(char)>(t); } // expected-error{{cannot resolve}}
50 { bool b = reinterpret_cast<void (*)(char)>(t); } // expected-error{{cannot resolve}}
52 { bool b = reinterpret_cast<int (*)(char)>(g); } //ok
53 { bool b = static_cast<int (*)(char)>(t); } // expected-error{{cannot be static_cast}}
54 { bool b = static_cast<int (&)(char)>(t); } // expected-error{{does not match required}}
56 { bool b = static_cast<void (&)(char)>(f); } // expected-error{{does not match}}