blob: 1117253d367be8274c9f516cc2995709cbbc1dd3 [file] [log] [blame]
Fariborz Jahanian455acd92009-09-22 19:53:15 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3struct BASE {
Fariborz Jahanianb1663d02009-09-23 00:58:07 +00004 operator int &(); // expected-note 4 {{candidate function}}
Fariborz Jahanian455acd92009-09-22 19:53:15 +00005};
6struct BASE1 {
Fariborz Jahanianb1663d02009-09-23 00:58:07 +00007 operator int &(); // expected-note 4 {{candidate function}}
Fariborz Jahanian455acd92009-09-22 19:53:15 +00008};
9
10struct B : public BASE, BASE1 {
11
12};
13
14extern B f();
15
Fariborz Jahanianb1663d02009-09-23 00:58:07 +000016B b1;
17void func(const int ci, const char cc); // expected-note {{function not viable because of ambiguity in conversion of argument 1}}
18void func(const char ci, const B b); // expected-note {{function not viable because of ambiguity in conversion of argument 1}}
19void func(const B b, const int ci); // expected-note {{function not viable because of ambiguity in conversion of argument 2}}
20
21
Fariborz Jahanian455acd92009-09-22 19:53:15 +000022const int main() {
Fariborz Jahanianb1663d02009-09-23 00:58:07 +000023 func(b1, f()); // expected-error {{no matching function for call to 'func'}}
Fariborz Jahanian455acd92009-09-22 19:53:15 +000024 return f(); // expected-error {{conversion from 'struct B' to 'int const' is ambiguous}}
25}
26