From 93dbe8d76d1cdf06f6108260b0d35989e906ee9b Mon Sep 17 00:00:00 2001
From: Benjamin Kosnik <bkoz@gcc.gnu.org>
Date: Mon, 21 Jan 2002 04:08:54 +0000
Subject: [PATCH] [multiple changes]

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

	* include/bits/locale_facets.h (ctype<char>::classic_table):
	Remove definition.
	(ctype<char>::_S_ctable): Remove.
	* config/os/gnu-linux/bits/ctype_noninline.h
	(ctype<char>::_S_table): Remove definition.
	(ctype<char>::classic_table): Define.
	(ctype<char>::ctype): Replace _S_ctable with classic_table().
	* config/os/aix/bits/ctype_noninline.h: Same.
	* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
	* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
	* config/os/djgpp/bits/ctype_noninline.h: Same.
	* config/os/generic/bits/ctype_noninline.h: Same.
	* config/os/gnu-linux/bits/ctype_noninline.h: Same.
	* config/os/hpux/bits/ctype_noninline.h: Same.
	* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
	* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
	* config/os/mingw32/bits/ctype_noninline.h: Same.
	* config/os/newlib/bits/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.

2002-01-20  Danny Smith  <dannysmith@users.sourceforge.net>

	* config/os/mingw32/bits/ctype_noninline.h: Declare _ctype instead
	of _pctype. Use to define _S_ctable.  Add definition for alternate
	ctor.  Initialise _M_ctable to _S_ctable in ctors.
	(do_toupper, do_tolower): Use inline code appropriate for C-locale
	rather than ::toupper, ::tolower.

From-SVN: r49032
---
 libstdc++-v3/ChangeLog                        | 32 +++++++++++++++++
 .../config/os/aix/bits/ctype_noninline.h      | 11 +++---
 .../os/bsd/freebsd/bits/ctype_noninline.h     |  9 ++---
 .../os/bsd/netbsd/bits/ctype_noninline.h      |  5 +--
 .../config/os/djgpp/bits/ctype_noninline.h    |  5 +--
 .../config/os/generic/bits/ctype_noninline.h  | 11 +++---
 .../os/gnu-linux/bits/ctype_noninline.h       | 11 +++---
 .../config/os/hpux/bits/ctype_noninline.h     |  7 ++--
 .../os/irix/irix5.2/bits/ctype_noninline.h    |  5 +--
 .../os/irix/irix6.5/bits/ctype_noninline.h    |  5 +--
 .../config/os/mingw32/bits/ctype_noninline.h  | 36 +++++++++++++------
 .../config/os/newlib/bits/ctype_noninline.h   |  9 ++---
 .../solaris/solaris2.5/bits/ctype_noninline.h | 11 +++---
 .../solaris/solaris2.6/bits/ctype_noninline.h |  9 ++---
 .../solaris/solaris2.7/bits/ctype_noninline.h |  9 ++---
 libstdc++-v3/include/bits/locale_facets.h     |  4 +--
 16 files changed, 118 insertions(+), 61 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d8ada879324d..16dc9b3e0881 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,35 @@
+2002-01-20  Benjamin Kosnik  <bkoz@redhat.com>
+
+	* include/bits/locale_facets.h (ctype<char>::classic_table):
+	Remove definition.
+	(ctype<char>::_S_ctable): Remove.
+	* config/os/gnu-linux/bits/ctype_noninline.h
+	(ctype<char>::_S_table): Remove definition.
+	(ctype<char>::classic_table): Define.
+	(ctype<char>::ctype): Replace _S_ctable with classic_table().
+	* config/os/aix/bits/ctype_noninline.h: Same.
+	* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
+	* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
+	* config/os/djgpp/bits/ctype_noninline.h: Same.
+	* config/os/generic/bits/ctype_noninline.h: Same.
+	* config/os/gnu-linux/bits/ctype_noninline.h: Same.
+	* config/os/hpux/bits/ctype_noninline.h: Same.
+	* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
+	* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
+	* config/os/mingw32/bits/ctype_noninline.h: Same.
+	* config/os/newlib/bits/ctype_noninline.h: Same.
+	* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
+	* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
+	* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
+
+2002-01-20  Danny Smith  <dannysmith@users.sourceforge.net>
+
+	* config/os/mingw32/bits/ctype_noninline.h: Declare _ctype instead
+	of _pctype. Use to define _S_ctable.  Add definition for alternate
+	ctor.  Initialise _M_ctable to _S_ctable in ctors.
+	(do_toupper, do_tolower): Use inline code appropriate for C-locale
+	rather than ::toupper, ::tolower.
+
 2002-01-18  Loren Rittle <ljrittle@acm.org>
 
 	* testsuite/18_support/numeric_limits.cc (test_extrema<long double>):
diff --git a/libstdc++-v3/config/os/aix/bits/ctype_noninline.h b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h
index dabcae981bfa..0e081d79381f 100644
--- a/libstdc++-v3/config/os/aix/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h
@@ -33,18 +33,19 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
-  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
   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_table(__table ? __table : _S_ctable) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_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_table(__table ? __table : _S_ctable) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h
index db58ecb27c48..9b452444daa0 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h
@@ -33,18 +33,19 @@
   
 // Information as gleaned from /usr/include/ctype.h
   
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   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_table(__table ? __table : _S_ctable) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_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_table(__table ? __table : _S_ctable) 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h
index f27d93dbdc74..ee9475ee5fcf 100644
--- a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h
@@ -33,8 +33,9 @@
   
 // Information as gleaned from /usr/include/ctype.h
   
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 		     size_t __refs) 
diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
index fd68e8142316..e84468c66aea 100644
--- a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
@@ -33,8 +33,9 @@
   
 // Information as gleaned from DJGPP <ctype.h>
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false, 
 		     size_t __refs = 0) 
diff --git a/libstdc++-v3/config/os/generic/bits/ctype_noninline.h b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h
index 36846d74a082..9fec00b43d2b 100644
--- a/libstdc++-v3/config/os/generic/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h
@@ -34,20 +34,21 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
-  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
   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_table(__table == 0 ? _S_ctable : __table) 
+  _M_table(__table == 0 ? classic_table() : __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_table(__table == 0 ? _S_ctable : __table) 
+  _M_table(__table == 0 ? classic_table() : __table) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h
index 1f2bdcf9e65e..86a38fa8f584 100644
--- a/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h
@@ -40,9 +40,10 @@
   using _C_legacy::__ctype_b;
 #endif
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b;
-
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return __ctype_b; }  
+  
 #if _GLIBCPP_C_LOCALE_GNU
   ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, 
 		     size_t __refs) 
@@ -58,14 +59,14 @@
 		     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
   _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
-  _M_table(__table ? __table : _S_ctable)
+  _M_table(__table ? __table : classic_table())
   { _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_table(__table ? __table : _S_ctable)
+  _M_table(__table ? __table : classic_table())
   { _M_c_locale_ctype = NULL; }
 
   char
diff --git a/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h b/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h
index fae41de2ca00..7ec3b30ed9c4 100644
--- a/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h
@@ -34,9 +34,10 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
-  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 		     size_t __refs) 
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
index 10fef4e5bcab..f9df21fb0d01 100644
--- a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
@@ -34,8 +34,9 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 		     size_t __refs)
diff --git a/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
index 73676f0c58cb..009e6110b73c 100644
--- a/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
@@ -33,8 +33,9 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 		     size_t __refs)
diff --git a/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h b/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h
index a877cf80fa7c..11a78436664e 100644
--- a/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 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
@@ -33,26 +33,37 @@
   
 // Information as gleaned from /mingw32/include/ctype.h.
 
-// This should be in mingw's ctype.h but isn't in older versions
+  // This should be in mingw's ctype.h but isn't in older versions
+  // Static classic C-locale table.  _ctype[0] is EOF
+  extern "C"  unsigned short  __declspec(dllimport) _ctype[];
 
-  extern "C"  unsigned short*  __declspec(dllimport) _pctype;  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _ctype + 1; }  
+
+  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(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_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 ? (_pctype) : __table) 
-    { }
+  : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table()) 
+  { }
 
   char
   ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
+  { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
 
   const char*
   ctype<char>::do_toupper(char* __low, const char* __high) const
   {
     while (__low < __high)
       {
-	*__low = ::toupper((int) *__low);
+	*__low = this->do_toupper(*__low);
 	++__low;
       }
     return __high;
@@ -60,16 +71,19 @@
 
   char
   ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
+  { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
 
   const char* 
   ctype<char>::do_tolower(char* __low, const char* __high) const
   {
     while (__low < __high)
       {
-	*__low = ::tolower((int) *__low);
+	*__low = this->do_tolower(*__low);
 	++__low;
       }
     return __high;
   }
 
+
+
+
diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h
index 89a486bcd5a0..546f5c5ac740 100644
--- a/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h
@@ -33,20 +33,21 @@
   
 // Information as gleaned from /usr/include/ctype.h
   
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
 
   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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h
index a37df89eebb7..9ab764a6c17b 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h
@@ -33,20 +33,21 @@
   
 // Information as gleaned from /usr/include/ctype.h
 
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
-  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
   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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h
index 19ad6d97ef1d..8e1c2d76f972 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h
@@ -33,20 +33,21 @@
   
 // Information as gleaned from /usr/include/ctype.h
   
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable;
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }  
 
   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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_table()) 
   { }
 
   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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h
index c668ae2a3dd8..eafc1fc71e24 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h
@@ -34,20 +34,21 @@
   
 // Information as gleaned from /usr/include/ctype.h
   
-  // Data for classic_table().
-  const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask;
+  const ctype_base::mask* 
+  ctype<char>::classic_table() throw()
+  { return __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_table(__table ? __table : _S_ctable) 
+  _M_table(__table ? __table : classic_table()) 
   { }
 
   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_table(__table == 0 ? __table : _S_ctable) 
+  _M_table(__table == 0 ? __table : classic_table()) 
   { }
 
   char
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 8108bf0c6fc0..9f435be5774f 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -238,7 +238,6 @@ namespace std
     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);
@@ -265,8 +264,7 @@ namespace std
       { return _M_table; }
 
       static const mask* 
-      classic_table() throw()
-      { return _S_ctable; }
+      classic_table() throw();
 
       virtual 
       ~ctype();
-- 
GitLab