From 6c669943b3e5ddb36b3d75b7f17450d271e634ce Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 25 Jan 2011 16:14:21 +0000 Subject: [PATCH] An rvalue reference cannot bind to an lvalue, so static_cast the result of the __tuple_leaf::get() call to an rvalue reference when returning from tuple's get(). git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124190 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/tuple | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tuple b/include/tuple index 8c3e1c4f..3f67ff8b 100644 --- a/include/tuple +++ b/include/tuple @@ -589,7 +589,8 @@ typename tuple_element<_Ip, tuple<_Tp...> >::type&& get(tuple<_Tp...>&& __t) { typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; - return static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get(); + return static_cast >::type&&>( + static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get()); } // tie