]> code.ossystems Code Review - openembedded-core.git/blob
f3ee5923a39ba28b3678f5d084c5d8cae9cf55fd
[openembedded-core.git] /
1 From 3329b7447ab817bb0374a689f3b381a5781ed8aa Mon Sep 17 00:00:00 2001
2 From: jyasskin <jyasskin@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Thu, 7 Apr 2011 04:50:23 +0000
4 Subject: [PATCH 076/200] Merge r172073 from trunk to the 4.6 release branch, to fix two
5  ambiguities between extensions and new C++0x functions.
6
7 Tested: bootstrap + make check-c++ on x86_64
8
9 libstdc++-v3/ChangeLog:
10
11 2011-04-06  Jeffrey Yasskin  <jyasskin@google.com>
12
13         * include/ext/algorithm (is_sorted): In C++0x mode import from
14         namespace std.
15         * include/ext/numeric (iota): In C++0x mode import from
16         namespace std.
17         * testsuite/ext/is_sorted/cxx0x.cc: New.
18         * testsuite/ext/iota/cxx0x.cc: New.
19
20
21
22 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172074 138bc75d-0d04-0410-961f-82ee72b054a4
23
24 index 368b591..417a03a 100644
25 --- a/libstdc++-v3/include/ext/algorithm
26 +++ b/libstdc++-v3/include/ext/algorithm
27 @@ -471,6 +471,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
28      }
29  #endif
30  
31 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
32 +  using std::is_sorted;
33 +#else
34    // is_sorted, a predicated testing whether a range is sorted in
35    // nondescending order.  This is an extension, not part of the C++
36    // standard.
37 @@ -526,6 +529,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
38           return false;
39        return true;
40      }
41 +#endif  // __GXX_EXPERIMENTAL_CXX0X__
42  
43    /**
44     *  @brief Find the median of three values.
45 diff --git a/libstdc++-v3/include/ext/numeric b/libstdc++-v3/include/ext/numeric
46 index d4a367f..b389177 100644
47 --- a/libstdc++-v3/include/ext/numeric
48 +++ b/libstdc++-v3/include/ext/numeric
49 @@ -123,6 +123,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
50      power(_Tp __x, _Integer __n)
51      { return __power(__x, __n); }
52  
53 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
54 +  using std::iota;
55 +#else
56    /**
57     *  This is an SGI extension.
58     *  @ingroup SGIextensions
59 @@ -141,9 +144,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
60        while (__first != __last)
61         *__first++ = __value++;
62      }
63 +#endif  // __GXX_EXPERIMENTAL_CXX0X__
64  
65  _GLIBCXX_END_NAMESPACE_VERSION
66  } // namespace
67  
68  #endif
69 -
70 diff --git a/libstdc++-v3/testsuite/ext/iota/cxx0x.cc b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
71 new file mode 100644
72 index 0000000..84917ad
73 --- /dev/null
74 +++ b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
75 @@ -0,0 +1,28 @@
76 +// { dg-do compile }
77 +// { dg-options "-std=gnu++0x" }
78 +
79 +// Copyright (C) 2011 Free Software Foundation, Inc.
80 +//
81 +// This file is part of the GNU ISO C++ Library.  This library is free
82 +// software; you can redistribute it and/or modify it under the
83 +// terms of the GNU General Public License as published by the
84 +// Free Software Foundation; either version 3, or (at your option)
85 +// any later version.
86 +
87 +// This library is distributed in the hope that it will be useful,
88 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
89 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
90 +// GNU General Public License for more details.
91 +
92 +// You should have received a copy of the GNU General Public License along
93 +// with this library; see the file COPYING3.  If not see
94 +// <http://www.gnu.org/licenses/>.
95 +
96 +#include <ext/numeric>
97 +#include <vector>
98 +
99 +void foo()
100 +{
101 +  std::vector<int> v;
102 +  iota(v.begin(), v.end(), 0);
103 +}
104 diff --git a/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
105 new file mode 100644
106 index 0000000..518716c
107 --- /dev/null
108 +++ b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
109 @@ -0,0 +1,28 @@
110 +// { dg-do compile }
111 +// { dg-options "-std=gnu++0x" }
112 +
113 +// Copyright (C) 2011 Free Software Foundation, Inc.
114 +//
115 +// This file is part of the GNU ISO C++ Library.  This library is free
116 +// software; you can redistribute it and/or modify it under the
117 +// terms of the GNU General Public License as published by the
118 +// Free Software Foundation; either version 3, or (at your option)
119 +// any later version.
120 +
121 +// This library is distributed in the hope that it will be useful,
122 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
123 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
124 +// GNU General Public License for more details.
125 +
126 +// You should have received a copy of the GNU General Public License along
127 +// with this library; see the file COPYING3.  If not see
128 +// <http://www.gnu.org/licenses/>.
129 +
130 +#include <ext/algorithm>
131 +#include <vector>
132 +
133 +void foo()
134 +{
135 +  std::vector<int> v;
136 +  is_sorted(v.begin(), v.end());
137 +}
138 -- 
139 1.7.0.4
140