blob: 6da035440095a569e394c6930b29172b34ee688e [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) {
24 f(text());
John McCall5acb0c92011-10-17 18:40:02 +000025 f(text); // expected-error {{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 +000026 f(text());
John McCall5acb0c92011-10-17 18:40:02 +000027 f(text); // expected-error {{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 +000028 }
29 };
30}