Fariborz Jahanian | 51bebc8 | 2009-09-23 20:55:32 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify -std=c++0x %s |
| 2 | |
Fariborz Jahanian | 27687cf | 2009-10-12 17:51:19 +0000 | [diff] [blame] | 3 | struct A {}; |
Fariborz Jahanian | 51bebc8 | 2009-09-23 20:55:32 +0000 | [diff] [blame] | 4 | |
| 5 | struct BASE { |
| 6 | operator A(); // expected-note {{candidate function}} |
| 7 | }; |
| 8 | |
| 9 | struct BASE1 { |
| 10 | operator A(); // expected-note {{candidate function}} |
| 11 | }; |
| 12 | |
| 13 | class B : public BASE , public BASE1 |
| 14 | { |
| 15 | public: |
| 16 | B(); |
| 17 | } b; |
| 18 | |
| 19 | extern B f(); |
| 20 | |
Fariborz Jahanian | 893f955 | 2009-09-30 21:23:30 +0000 | [diff] [blame] | 21 | const int& ri = (void)0; // expected-error {{invalid initialization of reference of type 'int const &' from expression of type 'void'}} |
| 22 | |
Fariborz Jahanian | 51bebc8 | 2009-09-23 20:55:32 +0000 | [diff] [blame] | 23 | int main() { |
| 24 | const A& rca = f(); // expected-error {{rvalue reference cannot bind to lvalue due to multiple conversion functions}} |
| 25 | A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot be initialized with a temporary of type 'class B'}} |
| 26 | } |