Delete addressof for temporaries (LWG 2598)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 14 Nov 2016 03:44:56 +0000 (03:44 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Nov 2016 03:44:56 +0000 (03:44 +0000)
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.

From-SVN: r242375

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/move.h

index 71af4dc8d57b98bd8f3efb1d9d81418b698fee41..57a7be64b846300a61e2d610e05956ee5b11c7a1 100644 (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.
 
index a5002fca422cf7cb8ae94d1a913666cf8b1d9aee..d0aefe76cf02e9ef09ba4ac60cda3ee1c9e55b1a 100644 (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