OSDN Git Service

2005-07-01 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jul 2005 08:25:11 +0000 (08:25 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jul 2005 08:25:11 +0000 (08:25 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101501 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/testsuite/25_algorithms/find/17441.cc [new file with mode: 0644]

index 9b3a218..44fb2eb 100644 (file)
@@ -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
index ee73321..9a76452 100644 (file)
@@ -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 (file)
index 0000000..b184bfa
--- /dev/null
@@ -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;
+}