diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-04-30 12:37:47 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-05 12:26:41 +0100 |
commit | 478deec11f3349d61b1a922f047dc958dc07262a (patch) | |
tree | 1843907b36de2bcb8f821d49d8c9a88014ef0dc7 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch | |
parent | d42dccf886983ba14ccc868041d7bea0cf1a260e (diff) | |
download | poky-478deec11f3349d61b1a922f047dc958dc07262a.tar.gz |
gcc-4.6.0: Backport FSF 4.6 branch patches
This is set of bugfixes that has been done on
FSF gcc-4_2-branch since 4.6.0 was released
They will roll into 4.6.1 release once that
happens in coming approx 6 months time then
we can simply remove them thats the reason
so use a separate .inc file to define the
SRC_URI additions
(From OE-Core rev: b0d5b9f12adbce2c4a0df6059f5671188cd32293)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch new file mode 100644 index 0000000000..8fba412875 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0129-2011-04-15-Daniel-Krugler-daniel.kruegler-googlemail.patch | |||
@@ -0,0 +1,143 @@ | |||
1 | From 2ce87b6b9c9143a22381eec77bbf1fd7016e132d Mon Sep 17 00:00:00 2001 | ||
2 | From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Sat, 16 Apr 2011 00:55:53 +0000 | ||
4 | Subject: [PATCH 129/200] 2011-04-15 Daniel Krugler <daniel.kruegler@googlemail.com> | ||
5 | Paolo Carlini <paolo.carlini@oracle.com> | ||
6 | |||
7 | PR libstdc++/48635 | ||
8 | * include/bits/unique_ptr.h (unique_ptr<>::operator=(unique_ptr&&), | ||
9 | unique_ptr<>::operator=(unique_ptr<>&&), | ||
10 | unique_ptr<_Tp[],>::operator=(unique_ptr&&), | ||
11 | unique_ptr<_Tp[],>::operator=(unique_ptr<>&&)): Forward the deleter | ||
12 | instead of moving it. | ||
13 | * testsuite/20_util/unique_ptr/assign/48635.cc: New. | ||
14 | |||
15 | |||
16 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172533 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
17 | |||
18 | index 5df4325..1be2e7a 100644 | ||
19 | --- a/libstdc++-v3/include/bits/unique_ptr.h | ||
20 | +++ b/libstdc++-v3/include/bits/unique_ptr.h | ||
21 | @@ -171,7 +171,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | ||
22 | operator=(unique_ptr&& __u) | ||
23 | { | ||
24 | reset(__u.release()); | ||
25 | - get_deleter() = std::move(__u.get_deleter()); | ||
26 | + get_deleter() = std::forward<deleter_type>(__u.get_deleter()); | ||
27 | return *this; | ||
28 | } | ||
29 | |||
30 | @@ -184,7 +184,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | ||
31 | operator=(unique_ptr<_Up, _Ep>&& __u) | ||
32 | { | ||
33 | reset(__u.release()); | ||
34 | - get_deleter() = std::move(__u.get_deleter()); | ||
35 | + get_deleter() = std::forward<deleter_type>(__u.get_deleter()); | ||
36 | return *this; | ||
37 | } | ||
38 | |||
39 | @@ -315,7 +315,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | ||
40 | operator=(unique_ptr&& __u) | ||
41 | { | ||
42 | reset(__u.release()); | ||
43 | - get_deleter() = std::move(__u.get_deleter()); | ||
44 | + get_deleter() = std::forward<deleter_type>(__u.get_deleter()); | ||
45 | return *this; | ||
46 | } | ||
47 | |||
48 | @@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | ||
49 | operator=(unique_ptr<_Up, _Ep>&& __u) | ||
50 | { | ||
51 | reset(__u.release()); | ||
52 | - get_deleter() = std::move(__u.get_deleter()); | ||
53 | + get_deleter() = std::forward<deleter_type>(__u.get_deleter()); | ||
54 | return *this; | ||
55 | } | ||
56 | |||
57 | diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635.cc | ||
58 | new file mode 100644 | ||
59 | index 0000000..99b412b | ||
60 | --- /dev/null | ||
61 | +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635.cc | ||
62 | @@ -0,0 +1,78 @@ | ||
63 | +// { dg-options "-std=gnu++0x" } | ||
64 | + | ||
65 | +// Copyright (C) 2011 Free Software Foundation | ||
66 | +// | ||
67 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
68 | +// software; you can redistribute it and/or modify it under the | ||
69 | +// terms of the GNU General Public License as published by the | ||
70 | +// Free Software Foundation; either version 3, or (at your option) | ||
71 | +// any later version. | ||
72 | + | ||
73 | +// This library is distributed in the hope that it will be useful, | ||
74 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
75 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
76 | +// GNU General Public License for more details. | ||
77 | + | ||
78 | +// You should have received a copy of the GNU General Public License along | ||
79 | +// with this library; see the file COPYING3. If not see | ||
80 | +// <http://www.gnu.org/licenses/>. | ||
81 | + | ||
82 | +#include <memory> | ||
83 | +#include <testsuite_hooks.h> | ||
84 | + | ||
85 | +struct Deleter | ||
86 | +{ | ||
87 | + Deleter() = default; | ||
88 | + Deleter(const Deleter&) = default; | ||
89 | + Deleter(Deleter&&) = default; | ||
90 | + | ||
91 | + Deleter& | ||
92 | + operator=(const Deleter&) | ||
93 | + { | ||
94 | + bool test __attribute__((unused)) = true; | ||
95 | + VERIFY( true ); | ||
96 | + return *this; | ||
97 | + } | ||
98 | + | ||
99 | + Deleter& | ||
100 | + operator=(Deleter&&) | ||
101 | + { | ||
102 | + bool test __attribute__((unused)) = true; | ||
103 | + VERIFY( false ); | ||
104 | + return *this; | ||
105 | + } | ||
106 | + | ||
107 | + template<class T> | ||
108 | + void | ||
109 | + operator()(T*) const { } | ||
110 | +}; | ||
111 | + | ||
112 | +struct DDeleter : Deleter { }; | ||
113 | + | ||
114 | +// libstdc++/48635 | ||
115 | +void test01() | ||
116 | +{ | ||
117 | + Deleter d; | ||
118 | + | ||
119 | + std::unique_ptr<int, Deleter&> p1(nullptr, d), p2(nullptr, d); | ||
120 | + p2 = std::move(p1); | ||
121 | + | ||
122 | + DDeleter dd; | ||
123 | + | ||
124 | + std::unique_ptr<int, DDeleter&> p1t(nullptr, dd); | ||
125 | + std::unique_ptr<int, Deleter&> p2t(nullptr, d); | ||
126 | + p2t = std::move(p1t); | ||
127 | + | ||
128 | + std::unique_ptr<int[], Deleter&> p1a(nullptr, d), p2a(nullptr, d); | ||
129 | + p2a = std::move(p1a); | ||
130 | + | ||
131 | + std::unique_ptr<int[], DDeleter&> p1at(nullptr, dd); | ||
132 | + std::unique_ptr<int[], Deleter&> p2at(nullptr, d); | ||
133 | + p2at = std::move(p1at); | ||
134 | +} | ||
135 | + | ||
136 | +int main() | ||
137 | +{ | ||
138 | + test01(); | ||
139 | + return 0; | ||
140 | +} | ||
141 | -- | ||
142 | 1.7.0.4 | ||
143 | |||