1 From f6e12aec843ba3a839f49b60a5ca092f2fadd876 Mon Sep 17 00:00:00 2001
2 From: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Sun, 10 Apr 2011 16:29:05 +0000
4 Subject: [PATCH 098/200] 2011-04-10 Jonathan Wakely <jwakely.gcc@gmail.com>
7 * include/std/functional (_Base_manager::_M_get_pointer): Use
9 * testsuite/20_util/function/48541.cc: New.
13 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172242 138bc75d-0d04-0410-961f-82ee72b054a4
15 index 6643b76..660e371 100644
16 --- a/libstdc++-v3/include/std/functional
17 +++ b/libstdc++-v3/include/std/functional
18 @@ -1586,7 +1586,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
19 _M_get_pointer(const _Any_data& __source)
21 const _Functor* __ptr =
22 - __stored_locally? &__source._M_access<_Functor>()
23 + __stored_locally? std::__addressof(__source._M_access<_Functor>())
24 /* have stored a pointer */ : __source._M_access<_Functor*>();
25 return const_cast<_Functor*>(__ptr);
27 diff --git a/libstdc++-v3/testsuite/20_util/function/48451.cc b/libstdc++-v3/testsuite/20_util/function/48451.cc
29 index 0000000..f812367
31 +++ b/libstdc++-v3/testsuite/20_util/function/48451.cc
33 +// { dg-options "-std=gnu++0x" }
35 +// Copyright (C) 2011 Free Software Foundation, Inc.
37 +// This file is part of the GNU ISO C++ Library. This library is free
38 +// software; you can redistribute it and/or modify it under the
39 +// terms of the GNU General Public License as published by the
40 +// Free Software Foundation; either version 3, or (at your option)
41 +// any later version.
43 +// This library is distributed in the hope that it will be useful,
44 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
45 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 +// GNU General Public License for more details.
48 +// You should have received a copy of the GNU General Public License along
49 +// with this library; see the file COPYING3. If not see
50 +// <http://www.gnu.org/licenses/>.
54 +#include <functional>
57 + void operator () () const { }
58 + float operator & () const { return 1.2345; }
64 + std::function<void()> f(x);