stl_iterator.h (reverse_iterator::_M_current): Deuglify, should be current.
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 17 Jan 2002 03:59:42 +0000 (03:59 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 17 Jan 2002 03:59:42 +0000 (03:59 +0000)
2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>
            Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>

* include/bits/stl_iterator.h (reverse_iterator::_M_current):
Deuglify, should be current.
(back_insert_iterator::_M_container): Deuglify, should be container.
(front_insert_iterator::_M_container): Same.
(insert_iterator::_M_container): Same.
* testsuite/24_iterators/reverse_iterator.cc: Add check.
* testsuite/24_iterators/back_insert_iterator.cc: Add check.
* testsuite/24_iterators/front_insert_iterator.cc: Same.
* testsuite/24_iterators/insert_iterator.cc: Same.

2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/locale_facets.h (ctype<char>::classic_table): Make
static.
(ctype<char>::_M_ctable): Make static, change name to _S_ctable.
* config/os/gnu-linux/bits/ctype_noninline.h: Define _S_ctable.
* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
* config/os/newlib/bits/ctype_noninline.h: Same.
* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
* config/os/hpux/bits/ctype_noninline.h: Same.
* config/os/djgpp/bits/ctype_noninline.h: Same.
* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
* config/os/aix/bits/ctype_noninline.h: Same.

Testcase by Dietmar K�hl via Peter Schmid
* testsuite/22_locale/ctype_members_char.cc (char>): Add test for
classic_table().

Co-Authored-By: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
From-SVN: r48938

21 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/os/aix/bits/ctype_noninline.h
libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h
libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h
libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
libstdc++-v3/config/os/generic/bits/ctype_noninline.h
libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h
libstdc++-v3/config/os/hpux/bits/ctype_noninline.h
libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
libstdc++-v3/config/os/newlib/bits/ctype_noninline.h
libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h
libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h
libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h
libstdc++-v3/include/bits/locale_facets.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/testsuite/22_locale/ctype_members_char.cc
libstdc++-v3/testsuite/24_iterators/back_insert_iterator.cc
libstdc++-v3/testsuite/24_iterators/front_insert_iterator.cc
libstdc++-v3/testsuite/24_iterators/insert_iterator.cc
libstdc++-v3/testsuite/24_iterators/reverse_iterator.cc

index d1d7992d94f2036124c43f92efe5f914b234f1b8..d2f7cf3260564e7619d5a7c90f3dc6fa837c88de 100644 (file)
@@ -1,3 +1,38 @@
+2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>
+            Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>
+
+       * include/bits/stl_iterator.h (reverse_iterator::_M_current):
+       Deuglify, should be current.
+       (back_insert_iterator::_M_container): Deuglify, should be container.
+       (front_insert_iterator::_M_container): Same.    
+       (insert_iterator::_M_container): Same.
+       * testsuite/24_iterators/reverse_iterator.cc: Add check.
+       * testsuite/24_iterators/back_insert_iterator.cc: Add check.    
+       * testsuite/24_iterators/front_insert_iterator.cc: Same.
+       * testsuite/24_iterators/insert_iterator.cc: Same.
+       
+2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/locale_facets.h (ctype<char>::classic_table): Make
+       static.
+       (ctype<char>::_M_ctable): Make static, change name to _S_ctable.
+       * config/os/gnu-linux/bits/ctype_noninline.h: Define _S_ctable.
+       * config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
+       * config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
+       * config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
+       * config/os/newlib/bits/ctype_noninline.h: Same.
+       * config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
+       * config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
+       * config/os/hpux/bits/ctype_noninline.h: Same.
+       * config/os/djgpp/bits/ctype_noninline.h: Same.
+       * config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
+       * config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
+       * config/os/aix/bits/ctype_noninline.h: Same.
+       
+       Testcase by Dietmar Kühl via Peter Schmid 
+       * testsuite/22_locale/ctype_members_char.cc (char>): Add test for
+       classic_table().
+
 2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>
 
        * libmath/signbitl.c: Copyright years as list, not range.       
index 2e13e3f59885b80c04ae149600859842f35079a3..dabcae981bfa1a74fc43f4322635f47a31b6314d 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002 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
 //
   
 // Information as gleaned from /usr/include/ctype.h
+
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
   
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) 
   { }
 
   char
index 3aee4dabe3f7623cc638c854eb1f7214f051603f..db58ecb27c486b24ddb0fac08dd7b132937daed3 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002 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
   
 // Information as gleaned from /usr/include/ctype.h
   
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) 
   { }
 
   char
index dcadbbed26bd05bc6822c731832f4cbae777c1b1..f27d93dbdc74e879b12b40bfd0adfc2eed25210d 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002 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
   
 // Information as gleaned from /usr/include/ctype.h
   
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? (_ctype_ + 1) : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(NULL), _M_tolower(NULL),
-  _M_ctable(NULL), _M_table(__table == 0 ? (_ctype_ + 1) : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
   { }
 
   char
index 2b075733a96a0692448fef9bc662baaf0a699480..fd68e814231610872d034b22dd1eee8073276830 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 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
   
 // Information as gleaned from DJGPP <ctype.h>
 
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false, 
                     size_t __refs = 0) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
-  _M_ctable(NULL), _M_table(__table == 0 ? __dj_ctype_flags : __table) 
+  _M_table(__table ? __table : __dj_ctype_flags)  
   { }
 
   ctype<char>::ctype(const mask* __table = 0, bool __del = false, 
                     size_t __refs = 0) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
-  _M_ctable(NULL), _M_table(__table == 0 ? __dj_ctype_flags : __table) 
+  _M_table(__table ? __table : __dj_ctype_flags)  
   { }
 
   char
index 90f9d75d93b56d2db4e668557b5305cac5933a37..36846d74a0820aa45b0fc378a1926ad4afba5561 100644 (file)
@@ -1,6 +1,7 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+//  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
 //
   
 // Information as gleaned from /usr/include/ctype.h
+
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
   
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
-  _M_table(__table == 0 ? _M_ctable : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table == 0 ? _S_ctable : __table) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
-  _M_table(__table == 0 ? _M_ctable : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table == 0 ? _S_ctable : __table) 
   { }
 
   char
index 91562dd0c4d9776dc50cab9be3a6d3f4a383bc80..1f2bdcf9e65eb093927defc33d053f1667335276 100644 (file)
@@ -1,6 +1,7 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// 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
   using _C_legacy::__ctype_b;
 #endif
 
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b;
+
 #if _GLIBCPP_C_LOCALE_GNU
   ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, 
                     size_t __refs) 
-  : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_ctable(__ctype_b)
+  : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
   {
     _M_c_locale_ctype = _S_clone_c_locale(__cloc);
     _M_toupper = _M_c_locale_ctype->__ctype_toupper;
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
-  _M_ctable(__ctype_b), _M_table(__table ? __table : __ctype_b)
+  _M_table(__table ? __table : _S_ctable)
   { _M_c_locale_ctype = NULL; }
 #endif
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : 
   __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
-  _M_ctable(__ctype_b), _M_table(__table == 0 ? _M_ctable : __table) 
+  _M_table(__table ? __table : _S_ctable)
   { _M_c_locale_ctype = NULL; }
 
   char
index 5e91e51204285f04c44de39cbf3c37dd3a93c14f..fae41de2ca006c064a6cc780c9d7cc7ef0bdb36c 100644 (file)
 //
   
 // Information as gleaned from /usr/include/ctype.h
+
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
   
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
-  _M_table(__table == 0 ? (const mask *) __SB_masks : __table
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : (const mask *) __SB_masks
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
-  _M_table(__table == 0 ? (const mask *) __SB_masks : __table
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : (const mask *) __SB_masks
   { }
 
   char
index dbf13ee60d50b7466b634f6aa4673e45e9f91ac9..10fef4e5bcab28530141a9be758ae7cfa5556925 100644 (file)
@@ -1,6 +1,7 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001, 2002
+//  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
   
 // Information as gleaned from /usr/include/ctype.h
 
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
+  _M_toupper(NULL), _M_tolower(NULL), 
   _M_table(!__table ? __ctype : __table)
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
+  _M_toupper(NULL), _M_tolower(NULL), 
   _M_table(!__table ? __ctype : __table)
   { }
 
index a2f5e10ec44704a01e93b65576fab567b35d694f..f53f601fcb8f078b4beb74900ae483920b2232a7 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001, 2002 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
   
 // Information as gleaned from /usr/include/ctype.h
 
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
+  ctype<char>::ctype(const mask* __tab
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
+  _M_toupper(NULL), _M_tolower(NULL), 
   _M_table(!__table ? 
           (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL), 
+  _M_toupper(NULL), _M_tolower(NULL), 
   _M_table(!__table ? 
           (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) 
   { }
index ed2867f8f9242978f32b7a7ea9a8019b210431a7..89a486bcd5a0b9a3adcfb26bfe299a0a642eadd7 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002 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
   
 // Information as gleaned from /usr/include/ctype.h
   
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_), 
-  _M_table(__table == 0 ? _M_ctable : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : _S_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_), 
-  _M_table(__table == 0 ? _M_ctable : __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : _S_ctable) 
   { }
 
   char
index a7ec22329cb4148bf499458a53bf160394271405..a37df89eebb72f34d9d93f5d4b1d38b378a42745 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002 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
 //
   
 // Information as gleaned from /usr/include/ctype.h
+
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
   
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype), 
-  _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : _S_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype), 
-  _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : _S_ctable) 
   { }
 
   char
index 7f702a496421840fef0447d9e7ee23fc6c2c3686..ab873389c8b1467fdeb845705482e739179b7feb 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997-2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001, 2002 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
   
 // Information as gleaned from /usr/include/ctype.h
   
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__trans_upper), _M_tolower(__trans_lower), 
-  _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_ctable(__ctype_mask), _M_table(__table ? __table : _M_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__trans_upper), _M_tolower(__trans_lower), 
-  _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_ctable(__ctype_mask), _M_table(__table ? __table : _M_ctable) 
   { }
 
   char
index 73951815bde32c06aa3b2448b4b1ef1f78780ef0..c668ae2a3dd824e69a19203d7e3ba0cceeea54a1 100644 (file)
@@ -1,6 +1,7 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997-2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// 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
   
 // Information as gleaned from /usr/include/ctype.h
   
+  // Data for classic_table().
+  const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask;
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
                     size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__trans_upper), _M_tolower(__trans_lower),
-  _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_table(__table ? __table : _S_ctable) 
   { }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__trans_upper), _M_tolower(__trans_lower),
-  _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) 
+  _M_table(__table == 0 ? __table : _S_ctable) 
   { }
 
   char
index 7fad2e0e8fa1a3ff4669e74df5fed11cc52745f2..8108bf0c6fc0d023ffaeb7425ee244b5302876d7 100644 (file)
@@ -233,12 +233,12 @@ namespace std
       bool                     _M_del;
       __to_type                _M_toupper;
       __to_type                _M_tolower;
-      const mask*              _M_ctable;
       const mask*                      _M_table;
       
     public:
       static locale::id        id;
       static const size_t      table_size = 1 + static_cast<unsigned char>(-1);
+      static const mask*       _S_ctable;
 
       explicit 
       ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
@@ -264,9 +264,9 @@ namespace std
       table() const throw()
       { return _M_table; }
 
-      const mask* 
+      static const mask* 
       classic_table() throw()
-      { return _M_ctable; }
+      { return _S_ctable; }
 
       virtual 
       ~ctype();
index 5cfb5791e9afe553842c7633dbf216cdfffbe253..7acf4f41d145dba8125e126400322ce5d94710b2 100644 (file)
@@ -1,6 +1,6 @@
 // Iterators -*- C++ -*-
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 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
@@ -73,7 +73,7 @@ namespace std
                       typename iterator_traits<_Iterator>::reference>
     {
     protected:
-      _Iterator _M_current;
+      _Iterator current;
 
     public:
       typedef _Iterator                                       iterator_type;
@@ -86,22 +86,22 @@ namespace std
       reverse_iterator() { }
 
       explicit 
-      reverse_iterator(iterator_type __x) : _M_current(__x) { }
+      reverse_iterator(iterator_type __x) : current(__x) { }
 
       reverse_iterator(const reverse_iterator& __x) 
-      : _M_current(__x._M_current) { }
+      : current(__x.current) { }
 
       template<typename _Iter>
         reverse_iterator(const reverse_iterator<_Iter>& __x)
-       : _M_current(__x.base()) { }
+       : current(__x.base()) { }
     
       iterator_type 
-      base() const { return _M_current; }
+      base() const { return current; }
 
       reference 
       operator*() const 
       {
-       _Iterator __tmp = _M_current;
+       _Iterator __tmp = current;
        return *--__tmp;
       }
 
@@ -111,7 +111,7 @@ namespace std
       reverse_iterator& 
       operator++() 
       {
-       --_M_current;
+       --current;
        return *this;
       }
 
@@ -119,43 +119,43 @@ namespace std
       operator++(int) 
       {
        reverse_iterator __tmp = *this;
-       --_M_current;
+       --current;
        return __tmp;
       }
 
       reverse_iterator& 
       operator--() 
       {
-       ++_M_current;
+       ++current;
        return *this;
       }
 
       reverse_iterator operator--(int) 
       {
        reverse_iterator __tmp = *this;
-       ++_M_current;
+       ++current;
        return __tmp;
       }
       
       reverse_iterator 
       operator+(difference_type __n) const 
-      { return reverse_iterator(_M_current - __n); }
+      { return reverse_iterator(current - __n); }
 
       reverse_iterator& 
       operator+=(difference_type __n) 
       {
-       _M_current -= __n;
+       current -= __n;
        return *this;
       }
 
       reverse_iterator 
       operator-(difference_type __n) const 
-      { return reverse_iterator(_M_current + __n); }
+      { return reverse_iterator(current + __n); }
 
       reverse_iterator& 
       operator-=(difference_type __n) 
       {
-       _M_current += __n;
+       current += __n;
        return *this;
       }
 
@@ -217,18 +217,18 @@ namespace std
     : public iterator<output_iterator_tag, void, void, void, void>
     {
     protected:
-      _Container* _M_container;
+      _Container* container;
 
     public:
       typedef _Container          container_type;
       
       explicit 
-      back_insert_iterator(_Container& __x) : _M_container(&__x) { }
+      back_insert_iterator(_Container& __x) : container(&__x) { }
 
       back_insert_iterator&
       operator=(typename _Container::const_reference __value) 
       { 
-       _M_container->push_back(__value);
+       container->push_back(__value);
        return *this;
       }
 
@@ -252,17 +252,17 @@ namespace std
     : public iterator<output_iterator_tag, void, void, void, void>
     {
     protected:
-      _Container* _M_container;
+      _Container* container;
 
     public:
       typedef _Container          container_type;
 
-      explicit front_insert_iterator(_Container& __x) : _M_container(&__x) { }
+      explicit front_insert_iterator(_Container& __x) : container(&__x) { }
 
       front_insert_iterator&
       operator=(typename _Container::const_reference __value) 
       { 
-       _M_container->push_front(__value);
+       container->push_front(__value);
        return *this;
       }
 
@@ -286,19 +286,19 @@ namespace std
     : public iterator<output_iterator_tag, void, void, void, void>
     {
     protected:
-      _Container* _M_container;
+      _Container* container;
       typename _Container::iterator iter;
 
     public:
       typedef _Container          container_type;
       
       insert_iterator(_Container& __x, typename _Container::iterator __i) 
-      : _M_container(&__x), iter(__i) {}
+      : container(&__x), iter(__i) {}
    
       insert_iterator&
       operator=(const typename _Container::const_reference __value) 
       { 
-       iter = _M_container->insert(iter, __value);
+       iter = container->insert(iter, __value);
        ++iter;
        return *this;
       }
index 46f1256e8efb8c0d88f7a51e905196231caecae2..2ce966851b9ce4a39bbe7822443d6324a41d2de2 100644 (file)
@@ -234,9 +234,19 @@ void test02()
   VERIFY( v_c != v_de );
 }
 
+// Dietmar Kühl via Peter Schmid 
+class comma_ctype: public std::ctype<char>
+{
+public:
+  comma_ctype(): std::ctype<char>() { }
+  static void get_table()
+  { classic_table(); }
+};
+
 int main() 
 {
   test01();
   test02();
+
   return 0;
 }
index 60e7c23191116be542a17893f82cd7a8382505ec..63f64ea08e8a2c79ade9bf217d0fde15e9aa959b 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-06-21  Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 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
@@ -54,6 +54,15 @@ void test02()
   iterator_type it = std::back_inserter(li);
 }
 
+// Check data member 'container' accessible.
+class test_dm : public std::back_insert_iterator<std::list<int> >
+{
+  container_type l;
+  container_type* p;
+public:
+  test_dm():  std::back_insert_iterator<std::list<int> >(l), p(container) { }
+};
+
 int main() 
 { 
   test01();
index 4be3346a5ed6f443a72af445e3beb7131f15a881..cf446f63ddb286b44119a5d1d0767e7cba67813b 100644 (file)
@@ -53,6 +53,15 @@ void test02()
   iterator_type it = std::front_inserter(li);
 }
 
+// Check data member 'container' accessible.
+class test_dm : public std::front_insert_iterator<std::list<int> >
+{
+  container_type l;
+  container_type* p;
+public:
+  test_dm(): std::front_insert_iterator<std::list<int> >(l), p(container) { }
+};
+
 int main() 
 { 
   test01();
index d3dcd8816a926d6510c9c5ccbe3cb0705c430340..fda883327772184eaf72b4352928f484a6107494 100644 (file)
@@ -60,6 +60,16 @@ void test02()
   iterator_type it02 = std::inserter(li, liit);
 }
 
+// Check data member 'container' accessible.
+class test_dm : public std::insert_iterator<std::list<int> >
+{
+  container_type l;
+  container_type::iterator i;
+  container_type* p;
+public:
+  test_dm(): std::insert_iterator<std::list<int> >(l, i), p(container) { }
+};
+
 int main() 
 { 
   test01();
index d20a44f8691a85630748a54c8f5efe442bfde8bf..f828a02218d1667690a8a37091c9eb7ead93b534 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-06-21  Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 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
@@ -67,6 +67,13 @@ void test02()
   5 + it02;
 }
 
+// Check data member 'current' accessible.
+class test_dm : public std::reverse_iterator<int*>
+{
+  int* p;
+public:
+  test_dm(): p(current) { }
+};
 
 int main() 
 { 
@@ -74,5 +81,3 @@ int main()
   test02();
   return 0;
 }
-
-