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