39 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3int ovl(int); // expected-note 3{{possible target for call}}4float ovl(float); // expected-note 3{{possible target for call}}5 6template<typename T> T ovl(T); // expected-note 3{{possible target for call}}7 8void test(bool b) {9 (void)((void)0, ovl); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}10 // PR786311 (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?}}13 (void)(b? ovl<float> : ovl<float>);14}15 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 {{reference to non-static member function must be called; did you mean to call it with no arguments?}}26 f(text());27 f(text); // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}}28 }29 };30}31 32namespace PR38077 {33 template <class T> void bar() {} // expected-note {{possible target for call}}34 35 int run() {36 decltype(bar)::does_not_exist; // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}37 }38}39