[PATCH] Delete addressof for temporaries (LWG 2598)
Jonathan Wakely
jwakely@redhat.com
Mon Nov 14 03:44:00 GMT 2016
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.
Tested powerpc64le-linux, committed to trunk.
-------------- next part --------------
commit 5eb75d53b4575e736bf295dbdad313a66839bd9b
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Nov 14 03:28:38 2016 +0000
Delete addressof for temporaries (LWG 2598)
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.
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
More information about the Libstdc++
mailing list