re PR libstdc++/15090 (-fno-for-scope vs. libstdc++)
authorSimon Marshall <simon.marshall@misys.com>
Thu, 13 May 2004 16:29:39 +0000 (16:29 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 13 May 2004 16:29:39 +0000 (16:29 +0000)
2004-05-13  Simon Marshall <simon.marshall@misys.com>
    Benjamin Kosnik  <bkoz@redhat.com>

PR libstdc++/15090
* include/bits/locale_facets.h: Fix for -fno-for-scope.
* include/debug/safe_sequence.h: Same.
* include/debug/safe_iterator.tcc: Same.
* src/debug.cc: Same.
* src/locale.cc: Same.
* src/locale_init.cc: Same.
* src/localename.cc: Same.
* config/locale/gnu/ctype_members.cc: Same.
* config/locale/gnu/numeric_members.cc: Same.
* testsuite/testsuite_abi.cc: Same.
* testsuite/testsuite_hooks.cc: Same.

Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com>
From-SVN: r81795

12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/gnu/ctype_members.cc
libstdc++-v3/config/locale/gnu/numeric_members.cc
libstdc++-v3/include/bits/locale_facets.h
libstdc++-v3/include/debug/safe_iterator.tcc
libstdc++-v3/include/debug/safe_sequence.h
libstdc++-v3/src/debug.cc
libstdc++-v3/src/locale.cc
libstdc++-v3/src/locale_init.cc
libstdc++-v3/src/localename.cc
libstdc++-v3/testsuite/testsuite_abi.cc
libstdc++-v3/testsuite/testsuite_hooks.cc

index 8e8ad9adec6169c037faf0e7f8c96520f38f34b2..34b79b6dedb252a6391c5d5448842a29e2e1b23a 100644 (file)
@@ -1,3 +1,19 @@
+2004-05-13  Simon Marshall <simon.marshall@misys.com>
+           Benjamin Kosnik  <bkoz@redhat.com>
+
+       PR libstdc++/15090
+       * include/bits/locale_facets.h: Fix for -fno-for-scope.
+       * include/debug/safe_sequence.h: Same.
+       * include/debug/safe_iterator.tcc: Same.
+       * src/debug.cc: Same.
+       * src/locale.cc: Same.
+       * src/locale_init.cc: Same.
+       * src/localename.cc: Same.
+       * config/locale/gnu/ctype_members.cc: Same.
+       * config/locale/gnu/numeric_members.cc: Same.
+       * testsuite/testsuite_abi.cc: Same.
+       * testsuite/testsuite_hooks.cc: Same.
+       
 2004-05-13  Jonathan Wakely  <redi@gcc.gnu.org>
        
        * docs/html/abi.html: Document effect of -fabi-version on value
index 2b31d11c2b2264e3081bb4aa7dda93a742b7ef76..7c53c15831db618cc3e25030ccb356cdbcb7ec58 100644 (file)
@@ -272,14 +272,14 @@ namespace std
       _M_narrow_ok = true;
     else
       _M_narrow_ok = false;
-    for (size_t __i = 0;
-        __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
-      _M_widen[__i] = btowc(__i);
+    for (size_t __j = 0;
+        __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
+      _M_widen[__j] = btowc(__j);
 
-    for (size_t __i = 0; __i <= 11; ++__i)
+    for (size_t __k = 0; __k <= 11; ++__k)
       { 
-       _M_bit[__i] = static_cast<mask>(_ISbit(__i));
-       _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
+       _M_bit[__k] = static_cast<mask>(_ISbit(__k));
+       _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
       }
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __uselocale(__old);
index 01e922515f375c5283f5ab4f1789b5fb31531086..34fadf456765825ead87b9ae8cf1a79d691c012a 100644 (file)
@@ -58,14 +58,16 @@ namespace std
          for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
            _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
 
-         for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
-           _M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
+         for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
+           _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
        }
       else
        {
          // Named locale.
-         _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, __cloc));
-         _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, __cloc));
+         _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
+                                                       __cloc));
+         _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
+                                                       __cloc));
 
          // Check for NULL, which implies no grouping.
          if (_M_data->_M_thousands_sep == '\0')
@@ -111,9 +113,9 @@ namespace std
            _M_data->_M_atoms_out[__i] =
              static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
 
-         for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
-           _M_data->_M_atoms_in[__i] =
-             static_cast<wchar_t>(__num_base::_S_atoms_in[__i]);
+         for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
+           _M_data->_M_atoms_in[__j] =
+             static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
        }
       else
        {
index 453ba78f20afa84c001c7cf2a5c8cf4c5f8e0723..c1d430db9844b712bb9c7d0194bb4a52add1b576 100644 (file)
@@ -1161,8 +1161,8 @@ namespace std
 
        _M_widen_ok = 1;
        // Set _M_widen_ok to 2 if memcpy can't be used.
-       for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
-         if (__tmp[__i] != _M_widen[__i])
+       for (size_t __j = 0; __j < sizeof(_M_widen); ++__j)
+         if (__tmp[__j] != _M_widen[__j])
            {
              _M_widen_ok = 2;
              break;
@@ -1182,11 +1182,11 @@ namespace std
        // Check if any default values were created.  Do this by
        // renarrowing with a different default value and comparing.
        bool __consecutive = true;
-       for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
-         if (!_M_narrow[__i])
+       for (size_t __j = 0; __j < sizeof(_M_narrow); ++__j)
+         if (!_M_narrow[__j])
            {
              char __c;
-             do_narrow(__tmp + __i, __tmp + __i + 1, 1, &__c);
+             do_narrow(__tmp + __j, __tmp + __j + 1, 1, &__c);
              if (__c == 1)
                {
                  __consecutive = false;
index 29813f4e8e28f3408eb454d9a325863a63c63274..cede969d168dc63b39aa827e802a78f8277f80c3 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging iterator implementation (out of line) -*- C++ -*-
 
-// Copyright (C) 2003
+// Copyright (C) 2003, 2004
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -123,11 +123,11 @@ namespace __gnu_debug
              if (this->base() == __victim->base())
                __victim->_M_version = 0;
            }
-         for (_Safe_iterator_base* iter = _M_sequence->_M_const_iterators;
-              iter; /* increment in loop */)
+         for (_Safe_iterator_base* iter2 = _M_sequence->_M_const_iterators;
+              iter2; /* increment in loop */)
            {
-             const_iterator* __victim = static_cast<const_iterator*>(iter);
-             iter = iter->_M_next;
+             const_iterator* __victim = static_cast<const_iterator*>(iter2);
+             iter2 = iter2->_M_next;
              if (this->base() == __victim->base())
                __victim->_M_version = 0;
            }
index 0bae9430313437f0b0bfd7e5d6dee26a515f0f07..f050530a997cbb1f7011ea20e7c4db265e4c27cc 100644 (file)
@@ -1,6 +1,6 @@
 // Safe sequence implementation  -*- C++ -*-
 
-// Copyright (C) 2003
+// Copyright (C) 2003, 2004
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -133,10 +133,10 @@ namespace __gnu_debug
           }
         }
 
-        for (_Safe_iterator_base* __iter = _M_const_iterators; __iter; )
+        for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2; )
         {
-          const_iterator* __victim = static_cast<const_iterator*>(__iter);
-          __iter = __iter->_M_next;
+          const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+          __iter2 = __iter2->_M_next;
           if (!__victim->_M_singular())
           {
            if (__pred(__victim->base()))
@@ -166,10 +166,11 @@ namespace __gnu_debug
            __victim->_M_attach(static_cast<_Sequence*>(this));
         }
 
-        for (_Safe_iterator_base* __iter = __from->_M_const_iterators; __iter;)
+        for (_Safe_iterator_base* __iter2 = __from->_M_const_iterators; 
+            __iter2;)
         {
-          const_iterator* __victim = static_cast<const_iterator*>(__iter);
-          __iter = __iter->_M_next;
+          const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+          __iter2 = __iter2->_M_next;
           if (!__victim->_M_singular() && __victim->base() == __x.base())
            __victim->_M_attach(static_cast<_Sequence*>(this));
         }
index 1d1aee46627892949e109b27d1d2afcffabd55fb..05ebc2ffa7b914dad4a6e10e8872c6bb766cb518 100644 (file)
@@ -114,10 +114,10 @@ namespace __gnu_debug
        __old->_M_attach(0, false);
       }
     
-    for (_Safe_iterator_base* __iter = _M_const_iterators; __iter; )
+    for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2; )
       {
-       _Safe_iterator_base* __old = __iter;
-       __iter = __iter->_M_next;
+       _Safe_iterator_base* __old = __iter2;
+       __iter2 = __iter2->_M_next;
        __old->_M_attach(0, true);
       }
   }
@@ -134,10 +134,10 @@ namespace __gnu_debug
          __old->_M_attach(0, false);
       }
 
-    for (_Safe_iterator_base* __iter = _M_const_iterators; __iter; )
+    for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2; )
       {
-       _Safe_iterator_base* __old = __iter;
-       __iter = __iter->_M_next;
+       _Safe_iterator_base* __old = __iter2;
+       __iter2 = __iter2->_M_next;
        if (__old->_M_singular())
          __old->_M_attach(0, true);
       }
index 64d0c6227aea6f4a0d7b30c54d578d729704f474..d28d39aed7676889021b0b117e2775a6913cb2b7 100644 (file)
@@ -241,23 +241,23 @@ namespace std
              _M_facets[__i]->_M_add_reference();
          }
        _M_caches = new const facet*[_M_facets_size];
-       for (size_t __i = 0; __i < _M_facets_size; ++__i)
+       for (size_t __j = 0; __j < _M_facets_size; ++__j)
          {
-           _M_caches[__i] = __imp._M_caches[__i];
-           if (_M_caches[__i])
-             _M_caches[__i]->_M_add_reference();       
+           _M_caches[__j] = __imp._M_caches[__j];
+           if (_M_caches[__j])
+             _M_caches[__j]->_M_add_reference();       
          }
        _M_names = new char*[_S_categories_size];
-       for (size_t __i = 0; __i < _S_categories_size; ++__i)
-         _M_names[__i] = 0;
+       for (size_t __k = 0; __k < _S_categories_size; ++__k)
+         _M_names[__k] = 0;
 
        // Name the categories.
-       for (size_t __i = 0; (__i < _S_categories_size
-                             && __imp._M_names[__i]); ++__i)
+       for (size_t __l = 0; (__l < _S_categories_size
+                             && __imp._M_names[__l]); ++__l)
          {
-           const size_t __len = std::strlen(__imp._M_names[__i]) + 1;
-           _M_names[__i] = new char[__len];
-           std::memcpy(_M_names[__i], __imp._M_names[__i], __len);
+           const size_t __len = std::strlen(__imp._M_names[__l]) + 1;
+           _M_names[__l] = new char[__len];
+           std::memcpy(_M_names[__l], __imp._M_names[__l], __len);
          }
       }
     catch(...)
@@ -269,7 +269,8 @@ namespace std
 
   void
   locale::_Impl::
-  _M_replace_category(const _Impl* __imp, const locale::id* const* __idpp)
+  _M_replace_category(const _Impl* __imp, 
+                     const locale::id* const* __idpp)
   {
     for (; *__idpp; ++__idpp)
       _M_replace_facet(__imp, *__idpp);
@@ -280,7 +281,8 @@ namespace std
   _M_replace_facet(const _Impl* __imp, const locale::id* __idp)
   {
     size_t __index = __idp->_M_id();
-    if ((__index > (__imp->_M_facets_size - 1)) || !__imp->_M_facets[__index])
+    if ((__index > (__imp->_M_facets_size - 1)) 
+       || !__imp->_M_facets[__index])
       __throw_runtime_error(__N("locale::_Impl::_M_replace_facet"));
     _M_install_facet(__idp, __imp->_M_facets[__index]); 
   }
@@ -304,8 +306,8 @@ namespace std
            __newf = new const facet*[__new_size]; 
            for (size_t __i = 0; __i < _M_facets_size; ++__i)
              __newf[__i] = _M_facets[__i];
-           for (size_t __i2 = _M_facets_size; __i2 < __new_size; ++__i2)
-             __newf[__i2] = 0;
+           for (size_t __l = _M_facets_size; __l < __new_size; ++__l)
+             __newf[__l] = 0;
 
            // New cache array.
            const facet** __oldc = _M_caches;
@@ -319,10 +321,10 @@ namespace std
                delete [] __newf;
                __throw_exception_again;
              }
-           for (size_t __i = 0; __i < _M_facets_size; ++__i)
-             __newc[__i] = _M_caches[__i];
-           for (size_t __i2 = _M_facets_size; __i2 < __new_size; ++__i2)
-             __newc[__i2] = 0;
+           for (size_t __j = 0; __j < _M_facets_size; ++__j)
+             __newc[__j] = _M_caches[__j];
+           for (size_t __k = _M_facets_size; __k < __new_size; ++__k)
+             __newc[__k] = 0;
 
            _M_facets_size = __new_size;
            _M_facets = __newf;
index d5a337f5b3716603f0ffe39482b822a38cb51d06..175ece6500d63b21a4b83593b5166b6282c332c6 100644 (file)
@@ -260,8 +260,8 @@ namespace std
     _M_names = new (&name_vec) char*[_S_categories_size];
     _M_names[0] = new (&name_c[0]) char[2];
     std::memcpy(_M_names[0], locale::facet::_S_get_c_name(), 2);
-    for (size_t __i = 1; __i < _S_categories_size; ++__i)
-      _M_names[__i] = 0;
+    for (size_t __j = 1; __j < _S_categories_size; ++__j)
+      _M_names[__j] = 0;
 
     // This is needed as presently the C++ version of "C" locales
     // != data in the underlying locale model for __timepunct,
index ca09b065156903c3dbbe9b22673b01a7d745986f..1600b2cc55b5839793195943edfda36ada72dedb 100644 (file)
@@ -193,11 +193,11 @@ namespace std
        for (size_t __i = 0; __i < _M_facets_size; ++__i)
          _M_facets[__i] = 0;
        _M_caches = new const facet*[_M_facets_size];
-       for (size_t __i = 0; __i < _M_facets_size; ++__i)
-         _M_caches[__i] = 0;
+       for (size_t __j = 0; __j < _M_facets_size; ++__j)
+         _M_caches[__j] = 0;
        _M_names = new char*[_S_categories_size];
-       for (size_t __i = 0; __i < _S_categories_size; ++__i)
-         _M_names[__i] = 0;
+       for (size_t __k = 0; __k < _S_categories_size; ++__k)
+         _M_names[__k] = 0;
 
        // Name the categories.
        const size_t __len = std::strlen(__s);
index 552da1bca0eca650e79a2275cb1a141726868db0..45d47777ddaafc3d39bdabaa0ffd832eee70c9bc 100644 (file)
@@ -328,25 +328,25 @@ compare_symbols(const char* baseline_file, const char* test_file,
   // Check missing names for compatibility.
   typedef pair<symbol, symbol> symbol_pair;
   vector<symbol_pair> incompatible;
-  for (size_t i = 0; i < missing_names.size(); ++i)
+  for (size_t j = 0; j < missing_names.size(); ++j)
     {
-      symbol base = baseline_objects[missing_names[i]];
+      symbol base = baseline_objects[missing_names[j]];
       incompatible.push_back(symbol_pair(base, base));
     }
 
   // Check shared names for compatibility.
-  for (size_t i = 0; i < shared_names.size(); ++i)
+  for (size_t k = 0; k < shared_names.size(); ++k)
     {
-      symbol base = baseline_objects[shared_names[i]];
-      symbol test = test_objects[shared_names[i]];
+      symbol base = baseline_objects[shared_names[k]];
+      symbol test = test_objects[shared_names[k]];
       if (!check_compatible(base, test))
        incompatible.push_back(symbol_pair(base, test));
     }
 
   // Check added names for compatibility.
-  for (size_t i = 0; i < added_names.size(); ++i)
+  for (size_t l = 0; l < added_names.size(); ++l)
     {
-      symbol test = test_objects[added_names[i]];
+      symbol test = test_objects[added_names[l]];
       if (!check_version(test, true))
        incompatible.push_back(symbol_pair(test, test));
     }
index 689a02b57e8b8769aaf1044cce5bc82c49de89e4..e12a9b41f594c235de03d5d63b5a293a15a2a779 100644 (file)
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 // Utility subroutines for the C++ library testsuite. 
 //
-// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003, 2004 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
@@ -373,8 +373,8 @@ namespace std
        }
       _M_data->_M_atoms_out[__num_base::_S_oend] = pod_type();
       
-      for (size_t i = 0; i < __num_base::_S_iend; ++i)
-       _M_data->_M_atoms_in[i].value = value_type(__num_base::_S_atoms_in[i]);
+      for (size_t j = 0; j < __num_base::_S_iend; ++j)
+       _M_data->_M_atoms_in[j].value = value_type(__num_base::_S_atoms_in[j]);
       _M_data->_M_atoms_in[__num_base::_S_iend] = pod_type();
 
       // "true"