summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/std/functional
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-14 23:33:01 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-14 23:33:01 +0000
commitf5bdb6efb2061fd474c511a1d77977c1fb24fc62 (patch)
tree61c548f3b9eeb6c0a2b15a23e063290fb69cd049 /libstdc++-v3/include/std/functional
parent2d68d2ef5ff898a3d34b28d57974c1c524ea3654 (diff)
downloadppe42-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/std/functional')
-rw-r--r--libstdc++-v3/include/std/functional8
1 files changed, 3 insertions, 5 deletions
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 4dbf4d55a10..561359c4779 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1,7 +1,6 @@
// <functional> -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-// 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2001-2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -1882,8 +1881,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
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()));
}
};
@@ -2317,9 +2315,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
if (_My_handler::_M_not_empty_function(__f))
{
+ _My_handler::_M_init_functor(_M_functor, std::move(__f));
_M_invoker = &_My_handler::_M_invoke;
_M_manager = &_My_handler::_M_manager;
- _My_handler::_M_init_functor(_M_functor, std::move(__f));
}
}
OpenPOWER on IntegriCloud