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.
7 Tested: bootstrap + make check-c++ on x86_64
9 libstdc++-v3/ChangeLog:
11 2011-04-06 Jeffrey Yasskin <jyasskin@google.com>
13 * include/ext/algorithm (is_sorted): In C++0x mode import from
15 * include/ext/numeric (iota): In C++0x mode import from
17 * testsuite/ext/is_sorted/cxx0x.cc: New.
18 * testsuite/ext/iota/cxx0x.cc: New.
22 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172074 138bc75d-0d04-0410-961f-82ee72b054a4
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
31 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
32 + using std::is_sorted;
34 // is_sorted, a predicated testing whether a range is sorted in
35 // nondescending order. This is an extension, not part of the C++
37 @@ -526,6 +529,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
41 +#endif // __GXX_EXPERIMENTAL_CXX0X__
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); }
53 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
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++;
63 +#endif // __GXX_EXPERIMENTAL_CXX0X__
65 _GLIBCXX_END_NAMESPACE_VERSION
70 diff --git a/libstdc++-v3/testsuite/ext/iota/cxx0x.cc b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
72 index 0000000..84917ad
74 +++ b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
77 +// { dg-options "-std=gnu++0x" }
79 +// Copyright (C) 2011 Free Software Foundation, Inc.
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.
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.
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/>.
96 +#include <ext/numeric>
101 + std::vector<int> v;
102 + iota(v.begin(), v.end(), 0);
104 diff --git a/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
106 index 0000000..518716c
108 +++ b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
110 +// { dg-do compile }
111 +// { dg-options "-std=gnu++0x" }
113 +// Copyright (C) 2011 Free Software Foundation, Inc.
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.
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.
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/>.
130 +#include <ext/algorithm>
135 + std::vector<int> v;
136 + is_sorted(v.begin(), v.end());