]> code.ossystems Code Review - openembedded-core.git/blob
eeb23592714083fc117c449d4140486e365cea33
[openembedded-core.git] /
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>
6
7         PR libstdc++/48398
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.
12
13
14 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171889 138bc75d-0d04-0410-961f-82ee72b054a4
15
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;
21        };
22  
23 -      typedef std::tuple<_Tp*, _Dp>    __tuple_type;
24 -      __tuple_type                     _M_t;
25 +      typedef std::tuple<typename _Pointer::type, _Dp>  __tuple_type;
26 +      __tuple_type                                      _M_t;
27  
28      public:
29 -      typedef typename _Pointer::type  pointer;
30 +      typedef typename _Pointer::type   pointer;
31        typedef _Tp                       element_type;
32        typedef _Dp                       deleter_type;
33  
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
35 new file mode 100644
36 index 0000000..54948df
37 --- /dev/null
38 +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/48398.cc
39 @@ -0,0 +1,41 @@
40 +// { dg-do compile }
41 +// { dg-options "-std=gnu++0x" }
42 +
43 +// Copyright (C) 2011 Free Software Foundation
44 +//
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.
50 +
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.
55 +
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/>.
59 +
60 +// 20.7.1 Class template unique_ptr [unique.ptr]
61 +
62 +#include <memory>
63 +
64 +// PR libstdc++/48398
65 +
66 +struct my_deleter
67 +{
68 +  typedef int* pointer;
69 +
70 +  void operator()( pointer p ) { delete p; }
71 +};
72 +
73 +void test01()
74 +{
75 +  std::unique_ptr<void, my_deleter> p( new int() );
76 +
77 +  p.get();
78 +  p.reset();
79 +
80 +}
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
85 @@ -1,7 +1,7 @@
86  // { dg-do compile }
87  // { dg-options "-std=gnu++0x" }
88  
89 -// Copyright (C) 2010 Free Software Foundation
90 +// Copyright (C) 2010, 2011 Free Software Foundation
91  //
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
94 @@ -25,13 +25,13 @@
95  
96  struct A
97  {
98 -  void operator()(void* p) const { }
99 +  void operator()(void*) const { }
100  };
101  
102  struct B
103  {
104    typedef char* pointer;
105 -  void operator()(pointer p) const { }
106 +  void operator()(pointer) const { }
107  };
108  
109  int main()
110 -- 
111 1.7.0.4
112