diff options
Diffstat (limited to 'clang/test/SemaCXX/decl-init-ref.cpp')
-rw-r--r-- | clang/test/SemaCXX/decl-init-ref.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/decl-init-ref.cpp b/clang/test/SemaCXX/decl-init-ref.cpp index a87c0efae2a..9fb3f171d60 100644 --- a/clang/test/SemaCXX/decl-init-ref.cpp +++ b/clang/test/SemaCXX/decl-init-ref.cpp @@ -18,6 +18,8 @@ class B : public BASE , public BASE1 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'}} |