diff options
Diffstat (limited to 'test/SemaCXX/decl-init-ref.cpp')
-rw-r--r-- | test/SemaCXX/decl-init-ref.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp new file mode 100644 index 0000000000..a87c0efae2 --- /dev/null +++ b/test/SemaCXX/decl-init-ref.cpp @@ -0,0 +1,24 @@ +// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s + +struct A {}; // expected-note {{candidate function}} + +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(); + +int main() { + const A& rca = f(); // expected-error {{rvalue reference cannot bind to lvalue due to multiple conversion functions}} + A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot be initialized with a temporary of type 'class B'}} +} |