Delete addressof for temporaries (LWG 2598)

* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
	as per LWG 2598.

From-SVN: r242375
This commit is contained in:
Jonathan Wakely 2016-11-14 03:44:56 +00:00 committed by Jonathan Wakely
parent 9c52cc0189
commit 3ce968519a
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2016-11-14 Jonathan Wakely <jwakely@redhat.com>
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.
* include/std/future (future::share(), future<R&>::share())
(future<void>::share()): Add noexcept, as per LWG 2556.

View File

@ -137,6 +137,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
addressof(_Tp& __r) noexcept
{ return std::__addressof(__r); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2598. addressof works on temporaries
template<typename _Tp>
const _Tp* addressof(const _Tp&&) = delete;
// C++11 version of std::exchange for internal use.
template <typename _Tp, typename _Up = _Tp>
inline _Tp