From: Jonathan Wakely Date: Mon, 14 Nov 2016 03:44:56 +0000 (+0000) Subject: Delete addressof for temporaries (LWG 2598) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ce968519a2b871e3d396dd785359c47218dba1a;p=gcc.git Delete addressof for temporaries (LWG 2598) * include/bits/move.h (addressof(const _Tp&&)): Add deleted overload, as per LWG 2598. From-SVN: r242375 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 71af4dc8d57..57a7be64b84 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2016-11-14 Jonathan Wakely + * include/bits/move.h (addressof(const _Tp&&)): Add deleted overload, + as per LWG 2598. + * include/std/future (future::share(), future::share()) (future::share()): Add noexcept, as per LWG 2556. diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index a5002fca422..d0aefe76cf0 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 + const _Tp* addressof(const _Tp&&) = delete; + // C++11 version of std::exchange for internal use. template inline _Tp