PR libstdc++/28080 (partial)
authorPaolo Carlini <pcarlini@suse.de>
Sun, 18 Feb 2007 11:32:44 +0000 (11:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 18 Feb 2007 11:32:44 +0000 (11:32 +0000)
2007-02-18  Paolo Carlini  <pcarlini@suse.de>

PR libstdc++/28080 (partial)
* include/bits/stl_algobase.h: Do not include <climits>, use
std::numeric_limits.
* include/bits/stl_bvector.h: Use __CHAR_BIT__.
* config/locale/gnu/codecvt_members.cc: Include <climits>.
* config/locale/generic/codecvt_members.cc: Likewise.
* include/std/string: Do not include <algorithm>; do not include
<memory>, include <bits/allocator.h> instead.
* include/ext/vstring_fwd.h: Likewise.
* include/ext/vstring_util.h: Do not include <algorithm>.
* include/tr1/hashtable_policy.h: Include <algorithm>.
* testsuite/21_strings/basic_string/replace/char/1.cc: Likewise.
* testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Likewise.
* testsuite/23_containers/bitset/cons/1.cc: Likewise.
* testsuite/util/testsuite_character.h: Likewise.

* config/locale/gnu/codecvt_members.cc: Also include <cstdlib>,
for MB_CUR_MAX.
* config/locale/generic/codecvt_members.cc: Likewise.

From-SVN: r122089

13 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/generic/codecvt_members.cc
libstdc++-v3/config/locale/gnu/codecvt_members.cc
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/ext/vstring_fwd.h
libstdc++-v3/include/ext/vstring_util.h
libstdc++-v3/include/std/string
libstdc++-v3/include/tr1/hashtable_policy.h
libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc
libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc
libstdc++-v3/testsuite/util/testsuite_character.h

index 7544dd32b2977d1df46ad5f8b50152c3d2ea2fe3..eb1a05b3161c773eb0b2b337ca8f3b42e31cc6dc 100644 (file)
@@ -1,3 +1,25 @@
+2007-02-18  Paolo Carlini  <pcarlini@suse.de>
+
+       PR libstdc++/28080 (partial)
+       * include/bits/stl_algobase.h: Do not include <climits>, use
+       std::numeric_limits.
+       * include/bits/stl_bvector.h: Use __CHAR_BIT__.
+       * config/locale/gnu/codecvt_members.cc: Include <climits>.
+       * config/locale/generic/codecvt_members.cc: Likewise.
+       * include/std/string: Do not include <algorithm>; do not include
+       <memory>, include <bits/allocator.h> instead.
+       * include/ext/vstring_fwd.h: Likewise.
+       * include/ext/vstring_util.h: Do not include <algorithm>.
+       * include/tr1/hashtable_policy.h: Include <algorithm>.
+       * testsuite/21_strings/basic_string/replace/char/1.cc: Likewise.
+       * testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Likewise.
+       * testsuite/23_containers/bitset/cons/1.cc: Likewise.
+       * testsuite/util/testsuite_character.h: Likewise.
+
+       * config/locale/gnu/codecvt_members.cc: Also include <cstdlib>,
+       for MB_CUR_MAX.
+       * config/locale/generic/codecvt_members.cc: Likewise.
+
 2007-02-16  Paolo Carlini  <pcarlini@suse.de>
 
        Revert.
index 555c3b3cf3698df2375aa41845098511dfc16938..7b03b5b60ba4f4ae86ac1f6d8dd1d85f83667039 100644 (file)
@@ -1,6 +1,7 @@
 // std::codecvt implementation details, generic version -*- C++ -*-
 
-// Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -34,6 +35,8 @@
 // Written by Benjamin Kosnik <bkoz@redhat.com>
 
 #include <locale>
+#include <cstdlib>  // For MB_CUR_MAX
+#include <climits>  // For MB_LEN_MAX
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
index ac1fe9267c8ef76035868f760b8f9e97061bd993..949927dd03d5821cf41ac0641592da722a468b44 100644 (file)
@@ -1,6 +1,7 @@
 // std::codecvt implementation details, GNU version -*- C++ -*-
 
-// Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -34,6 +35,8 @@
 // Written by Benjamin Kosnik <bkoz@redhat.com>
 
 #include <locale>
+#include <cstdlib>  // For MB_CUR_MAX
+#include <climits>  // For MB_LEN_MAX
 #include <bits/c++locale_internal.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
index c24a4f8d839d3eab9de86ac790d4b7af02d704d7..35a8a0383d8f20b8d6535eb2962b34151f3c846c 100644 (file)
 #include <bits/c++config.h>
 #include <cstring>
 #include <cwchar>
-#include <climits>
 #include <cstdlib>
 #include <cstddef>
 #include <iosfwd>
 #include <bits/stl_pair.h>
 #include <bits/cpp_type_traits.h>
 #include <ext/type_traits.h>
+#include <limits>
 #include <bits/stl_iterator_base_types.h>
 #include <bits/stl_iterator_base_funcs.h>
 #include <bits/stl_iterator.h>
@@ -318,8 +318,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   // Helpers for streambuf iterators (either istream or ostream).
   template<typename _CharT>
-  typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, 
-                                 ostreambuf_iterator<_CharT> >::__type
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, 
+                                   ostreambuf_iterator<_CharT> >::__type
     __copy_aux(_CharT*, _CharT*, ostreambuf_iterator<_CharT>);
 
   template<typename _CharT>
@@ -328,7 +328,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __copy_aux(const _CharT*, const _CharT*, ostreambuf_iterator<_CharT>);
 
   template<typename _CharT>
-  typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, _CharT*>::__type
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+                                   _CharT*>::__type
     __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>,
               _CharT*);
 
@@ -979,17 +980,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __glibcxx_requires_valid_range(__first1, __last1);
     __glibcxx_requires_valid_range(__first2, __last2);
 
-#if CHAR_MAX == SCHAR_MAX
-    return std::lexicographical_compare((const signed char*) __first1,
-                                       (const signed char*) __last1,
-                                       (const signed char*) __first2,
-                                       (const signed char*) __last2);
-#else /* CHAR_MAX == SCHAR_MAX */
-    return std::lexicographical_compare((const unsigned char*) __first1,
-                                       (const unsigned char*) __last1,
-                                       (const unsigned char*) __first2,
-                                       (const unsigned char*) __last2);
-#endif /* CHAR_MAX == SCHAR_MAX */
+    if (std::numeric_limits<char>::is_signed)
+      return std::lexicographical_compare((const signed char*) __first1,
+                                         (const signed char*) __last1,
+                                         (const signed char*) __first2,
+                                         (const signed char*) __last2);
+    else
+      return std::lexicographical_compare((const unsigned char*) __first1,
+                                         (const unsigned char*) __last1,
+                                         (const unsigned char*) __first2,
+                                         (const unsigned char*) __last2);
   }
 
 _GLIBCXX_END_NAMESPACE
index 9dc26565802d7b2cdc1ff29667bcc4e73be0853b..de72dac353c486a2892ed751d078968bb2d47363 100644 (file)
@@ -1,6 +1,6 @@
 // vector<bool> specialization -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -65,7 +65,7 @@
 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
 
   typedef unsigned long _Bit_type;
-  enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
+  enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
 
   struct _Bit_reference
   {
index 953700676466e0bba8e088d8e70548a402aee40e..bc11d6038151d6a48e2f6f4822334b1804a2a2a4 100644 (file)
@@ -1,6 +1,6 @@
 // Versatile string forward -*- C++ -*-
 
-// Copyright (C) 2005 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 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
@@ -40,7 +40,7 @@
 
 #include <bits/c++config.h>
 #include <bits/char_traits.h>
-#include <memory>      // For allocator.
+#include <bits/allocator.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
index e29d8bfbe7a62bba005a548899c4244d539847b0..fee06e3f371296c969d9f25e2f43594ffb38f37e 100644 (file)
@@ -43,7 +43,6 @@
 #include <bits/stl_function.h>  // For less
 #include <bits/functexcept.h>
 #include <locale>
-#include <algorithm> // For std::distance, srd::search.
 
 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
index c38d52575153d3d8befb642400cb040aaac31a03..0899cfe5a10e26938dfe855f45bac77b22f0e0b1 100644 (file)
@@ -1,6 +1,7 @@
 // Components for manipulating sequences of characters -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+// 2005, 2006, 2007
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -43,8 +44,8 @@
 
 #include <bits/c++config.h>
 #include <bits/stringfwd.h>
-#include <bits/char_traits.h>
-#include <memory>      // For allocator.
+#include <bits/char_traits.h>  // NB: In turn includes stl_algobase.h
+#include <bits/allocator.h>
 #include <bits/cpp_type_traits.h>
 #include <iosfwd>      // For operators >>, <<, and getline decls.
 #include <bits/stl_iterator.h>
@@ -52,7 +53,6 @@
 #include <bits/basic_string.h>
 
 #ifndef _GLIBCXX_EXPORT_TEMPLATE
-# include <algorithm> // for find_if
 # include <bits/basic_string.tcc> 
 #endif
 
index 2d3830d544c874756e3a5746c49be52e837a5e27..568d2ff02bde5e257c9381ab3490cb8b9e4f98e4 100644 (file)
@@ -1,6 +1,6 @@
 // Internal policy header for TR1 unordered_set and unordered_map -*- C++ -*-
 
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 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
@@ -35,6 +35,7 @@
 #define _TR1_HASHTABLE_POLICY_H 1
 
 #include <functional> // _Identity, _Select1st
+#include <algorithm> // lower_bound
 #include <tr1/utility>
 #include <ext/type_traits.h>
 
index 87cc9f72b856886b17f87f0cff24f6dedfc99994..d8630ac46d323ae946810750cdb03af0e156df1f 100644 (file)
@@ -1,6 +1,7 @@
 // 1999-06-10 bkoz
 
-// Copyright (C) 1994, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007 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
@@ -21,6 +22,7 @@
 // 21.3.5.6 basic_string::replace
 
 #include <string>
+#include <algorithm> // for std::find
 #include <testsuite_hooks.h>
 
 bool test01(void)
index c4592fc64f34142fbeed95b7f0ff6649326e8883..d98c578ef39b615631077a93e52eaf89ce8b7592 100644 (file)
@@ -1,6 +1,7 @@
 // 1999-06-10 bkoz
 
-// Copyright (C) 1994, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007 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
@@ -21,6 +22,7 @@
 // 21.3.5.6 basic_string::replace
 
 #include <string>
+#include <algorithm> // for std::find
 #include <testsuite_hooks.h>
 
 bool test01(void)
index 68007633b4f000f598b4f28d41697f84ad4e3090..79aea91615f27e0c16b9c46b5ef01ea0a7e14d3a 100644 (file)
@@ -1,6 +1,7 @@
 // 1999-06-08 bkoz
 
-// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <bitset>
+#include <algorithm> // std::reverse
 #include <stdexcept>
 #include <testsuite_hooks.h>
 
index a9e4847105b12d4c35762eeb8e8106a6ac8151d6..547775bd8864155eb8573a61d05e8c87cc495da8 100644 (file)
@@ -3,7 +3,7 @@
 // Testing character type and state type with char_traits and codecvt
 // specializations for the C++ library testsuite.
 //
-// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 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
@@ -36,6 +36,7 @@
 #include <climits>
 #include <string> // for char_traits
 #include <locale> // for codecvt
+#include <algorithm> // for transform
 #include <ext/pod_char_traits.h>
 
 namespace __gnu_test