blob: 9fb3f171d6006934c8c79a28d528bac5f2ed9ccb [file] [log] [blame]
Fariborz Jahanian51bebc82009-09-23 20:55:32 +00001// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s
2
3struct A {}; // expected-note {{candidate function}}
4
5struct BASE {
6 operator A(); // expected-note {{candidate function}}
7};
8
9struct BASE1 {
10 operator A(); // expected-note {{candidate function}}
11};
12
13class B : public BASE , public BASE1
14{
15 public:
16 B();
17} b;
18
19extern B f();
20
Fariborz Jahanian893f9552009-09-30 21:23:30 +000021const int& ri = (void)0; // expected-error {{invalid initialization of reference of type 'int const &' from expression of type 'void'}}
22
Fariborz Jahanian51bebc82009-09-23 20:55:32 +000023int 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}