blob: 20eb91a608caddcd53c7444ebbdd9297be1b5082 [file] [log] [blame]
Fariborz Jahanian51bebc82009-09-23 20:55:32 +00001// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s
2
Douglas Gregor20093b42009-12-09 23:02:17 +00003struct A {}; // expected-note {{candidate function}}
Fariborz Jahanian51bebc82009-09-23 20:55:32 +00004
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() {
Douglas Gregor20093b42009-12-09 23:02:17 +000024 const A& rca = f(); // expected-error {{conversion from 'class B' to 'struct A const' is ambiguous}}
25 A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot bind to a temporary of type 'class B'}}
Fariborz Jahanian51bebc82009-09-23 20:55:32 +000026}