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}}
8 void t(T); // expected-note 3{{candidate function}} \
9 // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
11 void t(T *); // expected-note 3{{candidate function}} \
12 // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
14 template<class T> void u(T);
18 { bool b = (void (&)(char))f; } // expected-error{{does not match required type}}
19 { bool b = (void (*)(char))f; } // expected-error{{does not match required type}}
21 { bool b = (void (&)(int))f; } //ok
22 { bool b = (void (*)(int))f; } //ok
24 { bool b = static_cast<void (&)(char)>(f); } // expected-error{{does not match}}
25 { bool b = static_cast<void (*)(char)>(f); } // expected-error{{address of overloaded function}}
27 { bool b = static_cast<void (&)(int)>(f); } //ok
28 { bool b = static_cast<void (*)(int)>(f); } //ok
31 { bool b = reinterpret_cast<void (&)(char)>(f); } // expected-error{{cannot resolve}}
32 { bool b = reinterpret_cast<void (*)(char)>(f); } // expected-error{{cannot resolve}}
34 { bool b = reinterpret_cast<void (*)(char)>(g); } //ok
35 { bool b = static_cast<void (*)(char)>(g); } // expected-error{{not allowed}}
37 { bool b = reinterpret_cast<void (&)(int)>(f); } // expected-error{{cannot resolve}}
38 { bool b = reinterpret_cast<void (*)(int)>(f); } // expected-error{{cannot resolve}}
40 { bool b = (int (&)(char))t; } // expected-error{{does not match}}
41 { bool b = (int (*)(char))t; } // expected-error{{does not match}}
43 { bool b = (void (&)(int))t; } //ok
44 { bool b = (void (*)(int))t; } //ok
46 { bool b = static_cast<void (&)(char)>(t); } //ok
47 { bool b = static_cast<void (*)(char)>(t); } //ok
49 { bool b = static_cast<void (&)(int)>(t); } //ok
50 { bool b = static_cast<void (*)(int)>(t); } //ok
53 { bool b = reinterpret_cast<void (&)(char)>(t); } // expected-error{{cannot resolve}}
54 { bool b = reinterpret_cast<void (*)(char)>(t); } // expected-error{{cannot resolve}}
56 { bool b = reinterpret_cast<int (*)(char)>(g); } //ok
57 { bool b = static_cast<int (*)(char)>(t); } // expected-error{{cannot be static_cast}}
58 { bool b = static_cast<int (&)(char)>(t); } // expected-error{{does not match required}}
60 { bool b = static_cast<void (&)(char)>(f); } // expected-error{{does not match}}