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