Fariborz Jahanian | 455acd9 | 2009-09-22 19:53:15 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | struct BASE { |
Fariborz Jahanian | b1663d0 | 2009-09-23 00:58:07 +0000 | [diff] [blame^] | 4 | operator int &(); // expected-note 4 {{candidate function}} |
Fariborz Jahanian | 455acd9 | 2009-09-22 19:53:15 +0000 | [diff] [blame] | 5 | }; |
| 6 | struct BASE1 { |
Fariborz Jahanian | b1663d0 | 2009-09-23 00:58:07 +0000 | [diff] [blame^] | 7 | operator int &(); // expected-note 4 {{candidate function}} |
Fariborz Jahanian | 455acd9 | 2009-09-22 19:53:15 +0000 | [diff] [blame] | 8 | }; |
| 9 | |
| 10 | struct B : public BASE, BASE1 { |
| 11 | |
| 12 | }; |
| 13 | |
| 14 | extern B f(); |
| 15 | |
Fariborz Jahanian | b1663d0 | 2009-09-23 00:58:07 +0000 | [diff] [blame^] | 16 | B b1; |
| 17 | void func(const int ci, const char cc); // expected-note {{function not viable because of ambiguity in conversion of argument 1}} |
| 18 | void func(const char ci, const B b); // expected-note {{function not viable because of ambiguity in conversion of argument 1}} |
| 19 | void func(const B b, const int ci); // expected-note {{function not viable because of ambiguity in conversion of argument 2}} |
| 20 | |
| 21 | |
Fariborz Jahanian | 455acd9 | 2009-09-22 19:53:15 +0000 | [diff] [blame] | 22 | const int main() { |
Fariborz Jahanian | b1663d0 | 2009-09-23 00:58:07 +0000 | [diff] [blame^] | 23 | func(b1, f()); // expected-error {{no matching function for call to 'func'}} |
Fariborz Jahanian | 455acd9 | 2009-09-22 19:53:15 +0000 | [diff] [blame] | 24 | return f(); // expected-error {{conversion from 'struct B' to 'int const' is ambiguous}} |
| 25 | } |
| 26 | |