blob: a5ec51ced23da56354dca700e647e5d2b997a453 [file] [log] [blame]
Douglas Gregor7ad5d422010-11-09 21:07:58 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
John McCall6dbba4f2011-10-11 23:14:30 +00003int ovl(int); // expected-note 3{{possible target for call}}
4float ovl(float); // expected-note 3{{possible target for call}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00005
John McCall6dbba4f2011-10-11 23:14:30 +00006template<typename T> T ovl(T); // expected-note 3{{possible target for call}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00007
8void test(bool b) {
John McCall6dbba4f2011-10-11 23:14:30 +00009 (void)((void)0, ovl); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +000010 // PR7863
John McCall6dbba4f2011-10-11 23:14:30 +000011 (void)(b? ovl : &ovl); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
12 (void)(b? ovl<float> : &ovl); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
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) {
John McCall6dbba4f2011-10-11 23:14:30 +000024 // FIXME: why 2x?
Douglas Gregor8d5e18c2011-06-17 00:15:10 +000025 f(text());
John McCall6dbba4f2011-10-11 23:14:30 +000026 f(text); // expected-error 2{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
Douglas Gregor8d5e18c2011-06-17 00:15:10 +000027 f(text());
John McCall6dbba4f2011-10-11 23:14:30 +000028 f(text); // expected-error 2{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
Douglas Gregor8d5e18c2011-06-17 00:15:10 +000029 }
30 };
31}