2009-09-23 20:55:32 +00:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s
|
|
|
|
|
2009-12-09 23:02:17 +00:00
|
|
|
struct A {}; // expected-note {{candidate function}}
|
2009-09-23 20:55:32 +00:00
|
|
|
|
|
|
|
struct BASE {
|
|
|
|
operator A(); // expected-note {{candidate function}}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BASE1 {
|
|
|
|
operator A(); // expected-note {{candidate function}}
|
|
|
|
};
|
|
|
|
|
|
|
|
class B : public BASE , public BASE1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
B();
|
|
|
|
} b;
|
|
|
|
|
|
|
|
extern B f();
|
|
|
|
|
2009-09-30 21:23:30 +00:00
|
|
|
const int& ri = (void)0; // expected-error {{invalid initialization of reference of type 'int const &' from expression of type 'void'}}
|
|
|
|
|
2009-09-23 20:55:32 +00:00
|
|
|
int main() {
|
2009-12-09 23:02:17 +00:00
|
|
|
const A& rca = f(); // expected-error {{conversion from 'class B' to 'struct A const' is ambiguous}}
|
|
|
|
A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot bind to a temporary of type 'class B'}}
|
2009-09-23 20:55:32 +00:00
|
|
|
}
|