blob: 73f12a902723ae1f697e7f78632c41444d7ed876 [file] [log] [blame]
Douglas Gregor7ad5d422010-11-09 21:07:58 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
Douglas Gregordb2eae62011-03-16 19:16:25 +00003int ovl(int); // expected-note 3{{candidate function}}
4float ovl(float); // expected-note 3{{candidate function}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00005
Douglas Gregordb2eae62011-03-16 19:16:25 +00006template<typename T> T ovl(T); // expected-note 3{{candidate function}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00007
8void test(bool b) {
Douglas Gregordb2eae62011-03-16 19:16:25 +00009 (void)((void)0, ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +000010 // PR7863
Douglas Gregordb2eae62011-03-16 19:16:25 +000011 (void)(b? ovl : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}}
12 (void)(b? ovl<float> : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +000013 (void)(b? ovl<float> : ovl<float>);
14}
Douglas Gregor8d5e18c2011-06-17 00:15:10 +000015
16namespace rdar9623945 {
17 void f(...) {
18 }
19
20 class X {
21 public:
22 const char* text(void);
23 void g(void) {
24 f(text());
25 f(text); // expected-error{{a bound member function may only be called}}
26 f(text());
27 f(text); // expected-error{{a bound member function may only be called}}
28 }
29 };
30}