1 Upstream-Status: Inappropriate [Backport]
2 From 0d43ff3bbc445b0264f804cd6449069182045678 Mon Sep 17 00:00:00 2001
3 From: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Sat, 2 Apr 2011 15:34:01 +0000
5 Subject: [PATCH 058/200] 2011-04-02 Jonathan Wakely <redi@gcc.gnu.org>
8 * include/bits/unique_ptr.h (__tuple_type): Store pointer type.
9 * testsuite/20_util/unique_ptr/modifiers/48398.cc: New.
10 * testsuite/20_util/unique_ptr/requirements/pointer_type.cc: Remove
11 unused parameter name.
14 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171889 138bc75d-0d04-0410-961f-82ee72b054a4
16 index 5e8ab90..5df4325 100644
17 --- a/libstdc++-v3/include/bits/unique_ptr.h
18 +++ b/libstdc++-v3/include/bits/unique_ptr.h
19 @@ -100,11 +100,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
20 typedef decltype( __test<_Del>(0)) type;
23 - typedef std::tuple<_Tp*, _Dp> __tuple_type;
25 + typedef std::tuple<typename _Pointer::type, _Dp> __tuple_type;
29 - typedef typename _Pointer::type pointer;
30 + typedef typename _Pointer::type pointer;
31 typedef _Tp element_type;
32 typedef _Dp deleter_type;
34 diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/48398.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/48398.cc
36 index 0000000..54948df
38 +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/48398.cc
41 +// { dg-options "-std=gnu++0x" }
43 +// Copyright (C) 2011 Free Software Foundation
45 +// This file is part of the GNU ISO C++ Library. This library is free
46 +// software; you can redistribute it and/or modify it under the
47 +// terms of the GNU General Public License as published by the
48 +// Free Software Foundation; either version 3, or (at your option)
49 +// any later version.
51 +// This library is distributed in the hope that it will be useful,
52 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
53 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 +// GNU General Public License for more details.
56 +// You should have received a copy of the GNU General Public License along
57 +// with this library; see the file COPYING3. If not see
58 +// <http://www.gnu.org/licenses/>.
60 +// 20.7.1 Class template unique_ptr [unique.ptr]
64 +// PR libstdc++/48398
68 + typedef int* pointer;
70 + void operator()( pointer p ) { delete p; }
75 + std::unique_ptr<void, my_deleter> p( new int() );
81 diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/requirements/pointer_type.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/requirements/pointer_type.cc
82 index 5074844..55f28ca 100644
83 --- a/libstdc++-v3/testsuite/20_util/unique_ptr/requirements/pointer_type.cc
84 +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/requirements/pointer_type.cc
87 // { dg-options "-std=gnu++0x" }
89 -// Copyright (C) 2010 Free Software Foundation
90 +// Copyright (C) 2010, 2011 Free Software Foundation
92 // This file is part of the GNU ISO C++ Library. This library is free
93 // software; you can redistribute it and/or modify it under the
98 - void operator()(void* p) const { }
99 + void operator()(void*) const { }
104 typedef char* pointer;
105 - void operator()(pointer p) const { }
106 + void operator()(pointer) const { }