1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 int (*pfd)(double) = f; // selects f(double)
6 int (*pfd2)(double) = &f; // selects f(double)
7 int (*pfd3)(double) = ((&((f)))); // selects f(double)
8 int (*pfi)(int) = &f; // selects f(int)
9 // FIXME: This error message is not very good. We need to keep better
10 // track of what went wrong when the implicit conversion failed to
11 // give a better error message here.
12 int (*pfe)(...) = &f; // expected-error{{cannot initialize a variable of type 'int (*)(...)' with an rvalue of type '<overloaded function type>'}}
13 int (&rfi)(int) = f; // selects f(int)
14 int (&rfd)(double) = f; // selects f(double)
16 void g(int (*fp)(int)); // expected-note{{note: candidate function}}
17 void g(int (*fp)(float));
18 void g(int (*fp)(double)); // expected-note{{note: candidate function}}
26 template<typename T> T g3(T);
32 g(g2); // expected-error{{call to 'g' is ambiguous; candidates are:}}
36 template<typename T> T h1(T);
37 template<typename R, typename A1> R h1(A1);
40 void ha(int (*fp)(int));
41 void hb(int (*fp)(double));
49 void f(void (*)(A *));