diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp')
-rw-r--r-- | test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp b/test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp index 22892a6..212adc8 100644 --- a/test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp +++ b/test/CXX/expr/expr.post/expr.reinterpret.cast/p1-0x.cpp @@ -10,7 +10,10 @@ template<typename T> T&& xvalue(); void test_classification(char *ptr) { int (&fr0)(int) = reinterpret_cast<int (&&)(int)>(f); int &&ir0 = reinterpret_cast<int &&>(*ptr); - int &&ir1 = reinterpret_cast<int &&>(0); - int &&ir2 = reinterpret_cast<int &&>('a'); + int &&ir1 = reinterpret_cast<int &&>(0); // expected-error {{rvalue to reference type}} + int &&ir2 = reinterpret_cast<int &&>('a'); // expected-error {{rvalue to reference type}} int &&ir3 = reinterpret_cast<int &&>(xvalue<char>()); + // Per DR1268, reinterpret_cast can convert between lvalues and xvalues. + int &ir4 = reinterpret_cast<int &>(xvalue<char>()); + int &&ir5 = reinterpret_cast<int &&>(*ptr); } |