diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-11-14 03:44:56 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-11-14 03:44:56 +0000 |
commit | 3ce968519a2b871e3d396dd785359c47218dba1a (patch) | |
tree | efcd36288acf36ae6d394b93b8d3aa9ebb80394a | |
parent | 9c52cc0189659e70155ab6ace4dc498bbf9d2142 (diff) | |
download | gcc-3ce968519a2b871e3d396dd785359c47218dba1a.zip gcc-3ce968519a2b871e3d396dd785359c47218dba1a.tar.gz gcc-3ce968519a2b871e3d396dd785359c47218dba1a.tar.bz2 |
Delete addressof for temporaries (LWG 2598)
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.
From-SVN: r242375
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/move.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 71af4dc..57a7be6 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index a5002fc..d0aefe7 100644 --- a/libstdc++-v3/include/bits/move.h +++ b/libstdc++-v3/include/bits/move.h @@ -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 |