Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 3 | int ovl(int); // expected-note 3{{possible target for call}} |
| 4 | float ovl(float); // expected-note 3{{possible target for call}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 5 | |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 6 | template<typename T> T ovl(T); // expected-note 3{{possible target for call}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 7 | |
| 8 | void test(bool b) { |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 9 | (void)((void)0, ovl); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 10 | // PR7863 |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 11 | (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 Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 13 | (void)(b? ovl<float> : ovl<float>); |
| 14 | } |
Douglas Gregor | 8d5e18c | 2011-06-17 00:15:10 +0000 | [diff] [blame] | 15 | |
| 16 | namespace rdar9623945 { |
| 17 | void f(...) { |
| 18 | } |
| 19 | |
| 20 | class X { |
| 21 | public: |
| 22 | const char* text(void); |
| 23 | void g(void) { |
| 24 | f(text()); |
John McCall | 5acb0c9 | 2011-10-17 18:40:02 +0000 | [diff] [blame] | 25 | f(text); // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}} |
Douglas Gregor | 8d5e18c | 2011-06-17 00:15:10 +0000 | [diff] [blame] | 26 | f(text()); |
John McCall | 5acb0c9 | 2011-10-17 18:40:02 +0000 | [diff] [blame] | 27 | f(text); // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}} |
Douglas Gregor | 8d5e18c | 2011-06-17 00:15:10 +0000 | [diff] [blame] | 28 | } |
| 29 | }; |
| 30 | } |