diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
| commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
| tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaCXX/decl-init-ref.cpp | |
| parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/decl-init-ref.cpp')
| -rw-r--r-- | test/SemaCXX/decl-init-ref.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp new file mode 100644 index 000000000000..d7db647cd11a --- /dev/null +++ b/test/SemaCXX/decl-init-ref.cpp @@ -0,0 +1,26 @@ +// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s + +struct A {}; + +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(); + +const int& ri = (void)0; // expected-error {{invalid initialization of reference of type 'int const &' from expression of type 'void'}} + +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'}} +} |
