diff options
author | Paolo Carlini <pcarlini@suse.de> | 2005-07-01 08:25:11 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-07-01 08:25:11 +0000 |
commit | c1806f89e0c83083fe36c344e674bbee27e09178 (patch) | |
tree | c06b5b7b40d33135e64168941b4b1c7ac28c2175 | |
parent | 4f856a3e28c08d1b03bde0ec6a31da86917f02cf (diff) | |
download | gcc-c1806f89e0c83083fe36c344e674bbee27e09178.zip gcc-c1806f89e0c83083fe36c344e674bbee27e09178.tar.gz gcc-c1806f89e0c83083fe36c344e674bbee27e09178.tar.bz2 |
[multiple changes]
2005-07-01 Paolo Carlini <pcarlini@suse.de>
Port from libstdcxx_so_7-branch:
2004-10-28 Chris Jefferson <chris@bubblescope.net>
PR libstdc++/17441
* include/bit/stl_algo.h (find(,,,input_iterator_tag),
find(,,,random_access_interator_tag),
find_if(,,,input_iterator_tag),
find_if(,,,random_access_iterator_tag)): Uglify function name.
(find, find_if): Use new uglified specialisation names.
* testsuite/25_algorithms/find/17441.cc: New.
From-SVN: r101501
-rw-r--r-- | libstdc++-v3/ChangeLog | 13 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_algo.h | 24 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/25_algorithms/find/17441.cc | 43 |
3 files changed, 68 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9b3a218..44fb2eb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2005-07-01 Paolo Carlini <pcarlini@suse.de> + + Port from libstdcxx_so_7-branch: + 2004-10-28 Chris Jefferson <chris@bubblescope.net> + + PR libstdc++/17441 + * include/bit/stl_algo.h (find(,,,input_iterator_tag), + find(,,,random_access_interator_tag), + find_if(,,,input_iterator_tag), + find_if(,,,random_access_iterator_tag)): Uglify function name. + (find, find_if): Use new uglified specialisation names. + * testsuite/25_algorithms/find/17441.cc: New. + 2005-06-30 Ulrich Weigand <uweigand@de.ibm.com> * include/ext/pb_assoc/detail/hash_fn/mask_based_range_hashing.hpp diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index ee73321..9a76452 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -166,8 +166,8 @@ namespace std */ template<typename _InputIterator, typename _Tp> inline _InputIterator - find(_InputIterator __first, _InputIterator __last, - const _Tp& __val, input_iterator_tag) + __find(_InputIterator __first, _InputIterator __last, + const _Tp& __val, input_iterator_tag) { while (__first != __last && !(*__first == __val)) ++__first; @@ -181,8 +181,8 @@ namespace std */ template<typename _InputIterator, typename _Predicate> inline _InputIterator - find_if(_InputIterator __first, _InputIterator __last, - _Predicate __pred, input_iterator_tag) + __find_if(_InputIterator __first, _InputIterator __last, + _Predicate __pred, input_iterator_tag) { while (__first != __last && !__pred(*__first)) ++__first; @@ -196,8 +196,8 @@ namespace std */ template<typename _RandomAccessIterator, typename _Tp> _RandomAccessIterator - find(_RandomAccessIterator __first, _RandomAccessIterator __last, - const _Tp& __val, random_access_iterator_tag) + __find(_RandomAccessIterator __first, _RandomAccessIterator __last, + const _Tp& __val, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIterator>::difference_type __trip_count = (__last - __first) >> 2; @@ -248,8 +248,8 @@ namespace std */ template<typename _RandomAccessIterator, typename _Predicate> _RandomAccessIterator - find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Predicate __pred, random_access_iterator_tag) + __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, + _Predicate __pred, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIterator>::difference_type __trip_count = (__last - __first) >> 2; @@ -311,8 +311,8 @@ namespace std __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); - return std::find(__first, __last, __val, - std::__iterator_category(__first)); + return std::__find(__first, __last, __val, + std::__iterator_category(__first)); } /** @@ -333,8 +333,8 @@ namespace std __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); - return std::find_if(__first, __last, __pred, - std::__iterator_category(__first)); + return std::__find_if(__first, __last, __pred, + std::__iterator_category(__first)); } /** diff --git a/libstdc++-v3/testsuite/25_algorithms/find/17441.cc b/libstdc++-v3/testsuite/25_algorithms/find/17441.cc new file mode 100644 index 0000000..b184bfa --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/find/17441.cc @@ -0,0 +1,43 @@ +// Copyright (C) 2004, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 25.3.1 algorithms, find() + +#include <algorithm> + +using namespace std; + +template<typename InputIterator, typename Tp> + InputIterator + find(InputIterator first, InputIterator last, + const Tp& val, input_iterator_tag) + { return first; } + +// libstdc++/17441 +void test01() +{ + input_iterator_tag a; + int i; + find(&i, &i, 1, a); +} + +int main() +{ + test01(); + return 0; +} |