From 952eddef9aff85b1e92626e89baaf7a360e2ac85 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 22 Dec 2013 00:07:40 +0000 Subject: Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841 --- test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'test/CXX/expr/expr.post/expr.const.cast') diff --git a/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp b/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp index 76ea96f..f4c0f1a 100644 --- a/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp +++ b/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp @@ -6,14 +6,26 @@ unsigned int f(int); +struct X {}; + template T& lvalue(); template T&& xvalue(); template T prvalue(); -void test_classification(const int *ptr) { - int *ptr0 = const_cast(ptr); - int *ptr1 = const_cast(xvalue()); - int *ptr2 = const_cast(prvalue()); +void test_classification(const int *ptr, X x) { + int *&&ptr0 = const_cast(ptr); + int *&&ptr1 = const_cast(xvalue()); + int *&&ptr2 = const_cast(prvalue()); // expected-error {{const_cast from rvalue to reference type 'int *&&'}} + X &&ptr3 = const_cast(x); + X &&ptr4 = const_cast(xvalue()); + X &&ptr5 = const_cast(prvalue()); + + int *&ptr6 = const_cast(ptr); + int *&ptr7 = const_cast(xvalue()); // expected-error {{const_cast from rvalue to reference type 'int *&'}} + int *&ptr8 = const_cast(prvalue()); // expected-error {{const_cast from rvalue to reference type 'int *&'}} + X &ptr9 = const_cast(x); + X &ptrA = const_cast(xvalue()); // expected-error {{const_cast from rvalue to reference type 'X &'}} + X &ptrB = const_cast(prvalue()); // expected-error {{const_cast from rvalue to reference type 'X &'}} } struct A { -- cgit v1.1