diff options
| author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-14 23:33:01 +0000 |
|---|---|---|
| committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-14 23:33:01 +0000 |
| commit | f5bdb6efb2061fd474c511a1d77977c1fb24fc62 (patch) | |
| tree | 61c548f3b9eeb6c0a2b15a23e063290fb69cd049 /libstdc++-v3/include/tr1/functional | |
| parent | 2d68d2ef5ff898a3d34b28d57974c1c524ea3654 (diff) | |
| download | ppe42-gcc-f5bdb6efb2061fd474c511a1d77977c1fb24fc62.tar.gz ppe42-gcc-f5bdb6efb2061fd474c511a1d77977c1fb24fc62.zip | |
PR libstdc++/55320
* include/std/functional (function::function(F)): Set _M_manager after
operations that could throw.
(_Function_base::_Ref_manager::_M_init_functor): Use addressof.
* include/tr1/functional
(_Function_base::_Ref_manager::_M_init_functor): Use addressof.
(_Function_base::_Base_manager::_M_get_pointer): Likewise.
* testsuite/20_util/function/cons/55320.cc: New.
* testsuite/20_util/function/cons/addressof.cc: New.
* testsuite/20_util/function/cons/callable.cc: Remove header.
* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error line numbers.
* testsuite/tr1/3_function_objects/function/10.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193514 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/tr1/functional')
| -rw-r--r-- | libstdc++-v3/include/tr1/functional | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index 88a81495d87..61d6455bc1d 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -1615,7 +1615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_get_pointer(const _Any_data& __source) { const _Functor* __ptr = - __stored_locally? &__source._M_access<_Functor>() + __stored_locally? std::__addressof(__source._M_access<_Functor>()) /* have stored a pointer */ : __source._M_access<_Functor*>(); return const_cast<_Functor*>(__ptr); } @@ -1744,8 +1744,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static void _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f) { - // TBD: Use address_of function instead. - _Base::_M_init_functor(__functor, &__f.get()); + _Base::_M_init_functor(__functor, std::__addressof(__f.get())); } }; |

