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