blob: 4d27a207ce9e6ed1e8496bd17b5e5fa07eb8491e [file] [log] [blame]
Douglas Gregor5cdf8212009-02-12 00:15:05 +00001// RUN: clang -fsyntax-only -verify %s
2char *foo(float); // expected-note 3 {{candidate function}}
3
4void test_foo_1(float fv, double dv, float _Complex fc, double _Complex dc) {
5 char *cp1 = foo(fv);
6 char *cp2 = foo(dv);
7 // Note: GCC and EDG reject these two, but they are valid C99 conversions
8 char *cp3 = foo(fc);
9 char *cp4 = foo(dc);
10}
11
12int *foo(float _Complex); // expected-note 3 {{candidate function}}
13
14void test_foo_2(float fv, double dv, float _Complex fc, double _Complex dc) {
15 char *cp1 = foo(fv);
16 char *cp2 = foo(dv); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
17 int *ip = foo(fc);
18 int *lp = foo(dc); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
19}
20
21long *foo(double _Complex); // expected-note {{candidate function}}
22
23void test_foo_3(float fv, double dv, float _Complex fc, double _Complex dc) {
24 char *cp1 = foo(fv);
25 char *cp2 = foo(dv); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
26 int *ip = foo(fc);
27 long *lp = foo(dc);
28}
29
30char *promote_or_convert(double _Complex); // expected-note{{candidate function}}
31int *promote_or_convert(long double _Complex); // expected-note{{candidate function}}
32
33void test_promote_or_convert(float f, float _Complex fc) {
34 char *cp = promote_or_convert(fc);
35 int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
36}
37
38char *promote_or_convert2(float);
39int *promote_or_convert2(double _Complex);
40
41void test_promote_or_convert(float _Complex fc) {
42 int *cp = promote_or_convert2(fc);
43}