This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/9858] Extra virtual functions in ctype<char>


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9858



------- Additional Comments From bkoz at gcc dot gnu dot org  2003-10-21 03:03 -------
Try this...

2003-10-20  Benjamin Kosnik  <bkoz@redhat.com>
 
	PR libstdc++/9858
	* include/bits/locale_facets.h (ctype<char>): Remove
	__ctype_abstract_base.
	(ctype<char>::do_is): Remove.
	(ctype<char>::do_scan_is): Remove.
	* src/ctype.cc: Same. Inline the rest.
	* testsuite/22_locale/ctype/is/char/9858.cc: New.
	* config/os/aix/ctype_noninline.h: Adjust ctor.
	* config/os/bsd/freebsd/ctype_noninline.h: Same.
	* config/os/bsd/netbsd/ctype_noninline.h: Same.
	* config/os/djgpp/ctype_noninline.h: Same.
	* config/os/generic/ctype_noninline.h: Same.
	* config/os/gnu-linux/ctype_noninline.h: Same.
	* config/os/hpux/ctype_noninline.h: Same.
	* config/os/irix/irix5.2/ctype_noninline.h: Same.
	* config/os/irix/irix6.5/ctype_noninline.h: Same.
	* config/os/mingw32/ctype_noninline.h: Same.
	* config/os/newlib/ctype_noninline.h: Same.
	* config/os/qnx/qnx6.1/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.5/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.6/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.7/ctype_noninline.h: Same.
	* config/os/windiss/ctype_noninline.h: Same.

Index: config/os/aix/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/aix/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/aix/ctype_noninline.h	24 Jun 2002 05:48:44 -0000	1.1
--- config/os/aix/ctype_noninline.h	21 Oct 2003 02:55:56 -0000
***************
*** 39,51 ****
  
    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 : 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 : classic_table())
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
  		     size_t __refs)
!   : facet(__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)
!   : facet(__refs), _M_del(__table != 0 && __del),
    _M_toupper(NULL), _M_tolower(NULL),
    _M_table(__table ? __table : classic_table())
    { }
Index: config/os/bsd/freebsd/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/bsd/freebsd/ctype_noninline.h	24 Jun 2002 05:48:49 -0000	1.1
--- config/os/bsd/freebsd/ctype_noninline.h	21 Oct 2003 02:55:56 -0000
***************
*** 39,51 ****
  
    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 : 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 : classic_table()) 
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/bsd/netbsd/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h,v
retrieving revision 1.2
diff -c -p -r1.2 ctype_noninline.h
*** config/os/bsd/netbsd/ctype_noninline.h	27 Jun 2003 16:59:04 -0000	1.2
--- config/os/bsd/netbsd/ctype_noninline.h	21 Oct 2003 02:55:56 -0000
***************
*** 41,53 ****
  
    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 : 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 : classic_table())
    { }
--- 41,53 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : classic_table())
    { }
Index: config/os/djgpp/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/djgpp/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/djgpp/ctype_noninline.h	24 Jun 2002 05:49:04 -0000	1.1
--- config/os/djgpp/ctype_noninline.h	21 Oct 2003 02:55:56 -0000
***************
*** 39,51 ****
  
    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(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
    _M_table(__table ? __table : __dj_ctype_flags)  
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
    _M_table(__table ? __table : __dj_ctype_flags)  
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
    _M_table(__table ? __table : __dj_ctype_flags)  
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
    _M_table(__table ? __table : __dj_ctype_flags)  
    { }
Index: config/os/generic/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/generic/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/generic/ctype_noninline.h	24 Jun 2002 05:49:14 -0000	1.1
--- config/os/generic/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 40,52 ****
  
    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 : 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 : classic_table())
    { }
--- 40,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : classic_table())
    { }
Index: config/os/gnu-linux/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h,v
retrieving revision 1.5
diff -c -p -r1.5 ctype_noninline.h
*** config/os/gnu-linux/ctype_noninline.h	2 Oct 2003 16:56:39 -0000	1.5
--- config/os/gnu-linux/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 59,65 ****
  #if _GLIBCXX_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_c_locale_ctype = _S_clone_c_locale(__cloc);
      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
--- 59,65 ----
  #if _GLIBCXX_C_LOCALE_GNU
    ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del)
    {
      _M_c_locale_ctype = _S_clone_c_locale(__cloc);
      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
***************
*** 69,75 ****
  #else
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
    {
      char* __old=strdup(setlocale(LC_CTYPE, NULL));
      setlocale(LC_CTYPE, "C");
--- 69,75 ----
  #else
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del)
    {
      char* __old=strdup(setlocale(LC_CTYPE, NULL));
      setlocale(LC_CTYPE, "C");
***************
*** 89,96 ****
  #endif
  
  #if _GLIBCXX_C_LOCALE_GNU
!   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : 
!   __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
    {
      _M_c_locale_ctype = _S_get_c_locale(); 
      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
--- 89,96 ----
  #endif
  
  #if _GLIBCXX_C_LOCALE_GNU
!   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del)
    {
      _M_c_locale_ctype = _S_get_c_locale(); 
      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
***************
*** 98,105 ****
      _M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
    }
  #else
!   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : 
!   __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
    {
      char* __old=strdup(setlocale(LC_CTYPE, NULL));
      setlocale(LC_CTYPE, "C");
--- 98,105 ----
      _M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
    }
  #else
!   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del)
    {
      char* __old=strdup(setlocale(LC_CTYPE, NULL));
      setlocale(LC_CTYPE, "C");
Index: config/os/hpux/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/hpux/ctype_noninline.h,v
retrieving revision 1.2
diff -c -p -r1.2 ctype_noninline.h
*** config/os/hpux/ctype_noninline.h	22 Mar 2003 18:55:40 -0000	1.2
--- config/os/hpux/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 40,52 ****
  
    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 : (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_table(__table ? __table : (const mask *) __SB_masks) 
    { }
--- 40,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : (const mask *) __SB_masks) 
    { }
Index: config/os/irix/irix5.2/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/irix/irix5.2/ctype_noninline.h	24 Jun 2002 05:49:35 -0000	1.1
--- config/os/irix/irix5.2/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 40,52 ****
  
    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 ? 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 ? classic_table() : __table)
    { }
--- 40,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(!__table ? classic_table() : __table)
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(!__table ? classic_table() : __table)
    { }
Index: config/os/irix/irix6.5/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/irix/irix6.5/ctype_noninline.h	24 Jun 2002 05:49:41 -0000	1.1
--- config/os/irix/irix6.5/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 39,52 ****
  
    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 ? 
  	   (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_table(!__table ? 
  	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) 
--- 39,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _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)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(!__table ? 
  	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) 
Index: config/os/mingw32/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/mingw32/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/mingw32/ctype_noninline.h	24 Jun 2002 05:49:48 -0000	1.1
--- config/os/mingw32/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 43,55 ****
  
    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 : 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 : classic_table()) 
    { }
--- 43,55 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL),
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/newlib/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/newlib/ctype_noninline.h,v
retrieving revision 1.2
diff -c -p -r1.2 ctype_noninline.h
*** config/os/newlib/ctype_noninline.h	1 Aug 2002 22:17:23 -0000	1.2
--- config/os/newlib/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 39,51 ****
  
    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 : 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 : classic_table()) 
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/qnx/qnx6.1/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/qnx/qnx6.1/ctype_noninline.h	24 Jun 2002 05:50:15 -0000	1.1
--- config/os/qnx/qnx6.1/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 39,50 ****
  
    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 : _Ctype)
    { }
  
    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 : _Ctype)
    { }
  
--- 39,50 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
    { }
  
Index: config/os/solaris/solaris2.5/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/solaris/solaris2.5/ctype_noninline.h	24 Jun 2002 05:50:27 -0000	1.1
--- config/os/solaris/solaris2.5/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 39,51 ****
  
    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 : 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 : classic_table()) 
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__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) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/solaris/solaris2.6/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/solaris/solaris2.6/ctype_noninline.h	24 Jun 2002 05:50:34 -0000	1.1
--- config/os/solaris/solaris2.6/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 39,51 ****
  
    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 : 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 : classic_table()) 
    { }
--- 39,51 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__trans_upper), _M_tolower(__trans_lower), 
    _M_table(__table ? __table : classic_table()) 
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__trans_upper), _M_tolower(__trans_lower), 
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/solaris/solaris2.7/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/solaris/solaris2.7/ctype_noninline.h	24 Jun 2002 05:50:43 -0000	1.1
--- config/os/solaris/solaris2.7/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 40,52 ****
  
    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 : 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 : classic_table()) 
    { }
--- 40,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__trans_upper), _M_tolower(__trans_lower),
    _M_table(__table ? __table : classic_table()) 
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(__trans_upper), _M_tolower(__trans_lower),
    _M_table(__table ? __table : classic_table()) 
    { }
Index: config/os/windiss/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/windiss/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** config/os/windiss/ctype_noninline.h	24 Jun 2002 05:50:50 -0000	1.1
--- config/os/windiss/ctype_noninline.h	21 Oct 2003 02:55:57 -0000
***************
*** 40,52 ****
  
    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 ? 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 ? classic_table() : __table) 
    { }
--- 40,52 ----
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table == 0 ? classic_table() : __table) 
    { }
  
    ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
!   : facet(__refs), _M_del(__table != 0 && __del), 
    _M_toupper(NULL), _M_tolower(NULL), 
    _M_table(__table == 0 ? classic_table() : __table) 
    { }
Index: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.66
diff -c -p -r1.66 locale_facets.h
*** include/bits/locale_facets.h	2 Oct 2003 16:56:39 -0000	1.66
--- include/bits/locale_facets.h	21 Oct 2003 02:55:57 -0000
*************** namespace std
*** 334,340 ****
  
    // 22.2.1.3  ctype<char> specialization.
    template<>
!     class ctype<char> : public __ctype_abstract_base<char>
      {
      public:
        // Types:
--- 334,340 ----
  
    // 22.2.1.3  ctype<char> specialization.
    template<>
!     class ctype<char> : public locale::facet, public ctype_base
      {
      public:
        // Types:
*************** namespace std
*** 371,376 ****
--- 371,409 ----
        inline const char*
        scan_not(mask __m, const char* __lo, const char* __hi) const;
       
+       char_type 
+       toupper(char_type __c) const
+       { return this->do_toupper(__c); }
+ 
+       const char_type*
+       toupper(char_type *__lo, const char_type* __hi) const
+       { return this->do_toupper(__lo, __hi); }
+ 
+       char_type 
+       tolower(char_type __c) const
+       { return this->do_tolower(__c); }
+ 
+       const char_type*
+       tolower(char_type* __lo, const char_type* __hi) const
+       { return this->do_tolower(__lo, __hi); }
+ 
+       char_type 
+       widen(char __c) const
+       { return this->do_widen(__c); }
+ 
+       const char*
+       widen(const char* __lo, const char* __hi, char_type* __to) const
+       { return this->do_widen(__lo, __hi, __to); }
+ 
+       char 
+       narrow(char_type __c, char __dfault) const
+       { return this->do_narrow(__c, __dfault); }
+ 
+       const char_type*
+       narrow(const char_type* __lo, const char_type* __hi,
+ 	      char __dfault, char *__to) const
+       { return this->do_narrow(__lo, __hi, __dfault, __to); }
+ 
      protected:
        const mask* 
        table() const throw()
*************** namespace std
*** 382,400 ****
        virtual 
        ~ctype();
  
-       virtual bool 
-       do_is(mask __m, char_type __c) const;
- 
-       virtual const char_type*
-       do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
- 
-       virtual const char_type*
-       do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
- 
-       virtual const char_type*
-       do_scan_not(mask __m, const char_type* __lo, 
- 		  const char_type* __hi) const;
- 
        virtual char_type 
        do_toupper(char_type) const;
  
--- 415,420 ----
*************** namespace std
*** 408,424 ****
        do_tolower(char_type* __lo, const char_type* __hi) const;
        
        virtual char_type 
!       do_widen(char) const;
  
        virtual const char*
!       do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
  
        virtual char 
!       do_narrow(char_type, char __dfault) const;
  
        virtual const char_type*
        do_narrow(const char_type* __lo, const char_type* __hi,
! 		char __dfault, char* __dest) const;
      };
   
    template<>
--- 428,454 ----
        do_tolower(char_type* __lo, const char_type* __hi) const;
        
        virtual char_type 
!       do_widen(char __c) const
!       { return __c; }
  
        virtual const char*
!       do_widen(const char* __lo, const char* __hi, char_type* __dest) const
!       {
! 	memcpy(__dest, __lo, __hi - __lo);
! 	return __hi;
!       }
  
        virtual char 
!       do_narrow(char_type __c, char) const
!       { return __c; }
  
        virtual const char_type*
        do_narrow(const char_type* __lo, const char_type* __hi,
! 		char, char* __dest) const
!       {
! 	memcpy(__dest, __lo, __hi - __lo);
! 	return __hi;
!       }
      };
   
    template<>
Index: src/ctype.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/ctype.cc,v
retrieving revision 1.4
diff -c -p -r1.4 ctype.cc
*** src/ctype.cc	2 Oct 2003 16:56:39 -0000	1.4
--- src/ctype.cc	21 Oct 2003 02:55:57 -0000
***************
*** 30,39 ****
  
  namespace std 
  {
!   // XXX At some point, just rename this file to ctype_members_char.cc
!   // and compile it as a separate file instead of including it here.
!   // Platform-specific initialization code for ctype tables.
!   #include <bits/ctype_noninline.h>
  
    // Definitions for locale::id of standard facets that are specialized.
    locale::id ctype<char>::id;
--- 30,47 ----
  
  namespace std 
  {
!   // Definitions for static const data members of ctype_base.
!   const ctype_base::mask ctype_base::space;
!   const ctype_base::mask ctype_base::print;
!   const ctype_base::mask ctype_base::cntrl;
!   const ctype_base::mask ctype_base::upper;
!   const ctype_base::mask ctype_base::lower;
!   const ctype_base::mask ctype_base::alpha;
!   const ctype_base::mask ctype_base::digit;
!   const ctype_base::mask ctype_base::punct;
!   const ctype_base::mask ctype_base::xdigit;
!   const ctype_base::mask ctype_base::alnum;
!   const ctype_base::mask ctype_base::graph;
  
    // Definitions for locale::id of standard facets that are specialized.
    locale::id ctype<char>::id;
*************** namespace std 
*** 62,79 ****
      }
  #endif
  
!   // Definitions for static const data members of ctype_base.
!   const ctype_base::mask ctype_base::space;
!   const ctype_base::mask ctype_base::print;
!   const ctype_base::mask ctype_base::cntrl;
!   const ctype_base::mask ctype_base::upper;
!   const ctype_base::mask ctype_base::lower;
!   const ctype_base::mask ctype_base::alpha;
!   const ctype_base::mask ctype_base::digit;
!   const ctype_base::mask ctype_base::punct;
!   const ctype_base::mask ctype_base::xdigit;
!   const ctype_base::mask ctype_base::alnum;
!   const ctype_base::mask ctype_base::graph;
  
    const size_t ctype<char>::table_size;
  
--- 70,79 ----
      }
  #endif
  
!   // XXX At some point, just rename this file to ctype_configure_char.cc
!   // and compile it as a separate file instead of including it here.
!   // Platform-specific initialization code for ctype tables.
!   #include <bits/ctype_noninline.h>
  
    const size_t ctype<char>::table_size;
  
*************** namespace std 
*** 84,128 ****
        delete[] this->table(); 
    }
  
-   // These are dummy placeholders as these virtual functions are never called.
-   bool 
-   ctype<char>::do_is(mask, char_type) const 
-   { return false; }
-   
-   const char*
-   ctype<char>::do_is(const char_type* __c, const char_type*, mask*) const 
-   { return __c; }
-   
-   const char*
-   ctype<char>::do_scan_is(mask, const char_type* __c, const char_type*) const 
-   { return __c; }
- 
-   const char* 
-   ctype<char>::do_scan_not(mask, const char_type* __c, const char_type*) const
-   { return __c; }
- 
-   char
-   ctype<char>::do_widen(char __c) const
-   { return __c; }
-   
-   const char* 
-   ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
-   {
-     memcpy(__dest, __lo, __hi - __lo);
-     return __hi;
-   }
-   
-   char
-   ctype<char>::do_narrow(char __c, char /*__dfault*/) const
-   { return __c; }
-   
-   const char* 
-   ctype<char>::do_narrow(const char* __lo, const char* __hi, 
- 			 char /*__dfault*/, char* __dest) const
-   {
-     memcpy(__dest, __lo, __hi - __lo);
-     return __hi;
-   }
  
  #ifdef _GLIBCXX_USE_WCHAR_T
    ctype<wchar_t>::ctype(size_t __refs) 
--- 84,89 ----
Index: testsuite/22_locale/ctype/is/char/9858.cc
===================================================================
RCS file: testsuite/22_locale/ctype/is/char/9858.cc
diff -N testsuite/22_locale/ctype/is/char/9858.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/22_locale/ctype/is/char/9858.cc	21 Oct 2003 02:55:58 -0000
***************
*** 0 ****
--- 1,103 ----
+ // Copyright (C) 2003 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.
+ 
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction.  Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License.  This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+ 
+ // 22.2.1.3 - ctype specializations [lib.facet.ctype.special]
+ 
+ #include <locale>
+ #include <testsuite_hooks.h>
+ 
+ int called;
+ 
+ class Derived : public std::ctype<char>
+ {
+ public:
+   bool 
+   do_is(mask, char_type) const { return true; }
+ 
+   const char_type* 
+   do_is(const char_type* lo, const char_type* hi, mask* vec) const 
+   { return hi; }
+ 
+   const char_type* 
+   do_scan_is(mask m, const char_type* lo, const char_type* hi) const 
+   { return hi; }
+ 
+   const char_type* 
+   do_scan_not(mask m, const char_type* lo, const char_type* hi) const 
+   { return hi; }
+ };
+ 
+ class Derived2 : public Derived
+ {
+ public:
+   bool 
+   do_is(mask, char_type) const { called = 1; return true; }
+ 
+   const char_type* 
+   do_is(const char_type* lo, const char_type* hi, mask* vec) const 
+   { called = 5; return hi; }
+ 
+   const char_type* 
+   do_scan_is(mask m, const char_type* lo, const char_type* hi) const 
+   { called = 10; return hi; }
+ 
+   const char_type* 
+   do_scan_not(mask m, const char_type* lo, const char_type* hi) const 
+   { called = 15; return hi; }
+ };
+ 
+ int main()
+ {
+   using namespace std;
+   bool test __attribute__((unused)) = true;
+   Derived2 d2;
+   const Derived& dr = d2;
+ 
+   const char* lit = "jaylib champion sound";
+   ctype_base::mask m00 = static_cast<std::ctype_base::mask>(0);
+   ctype_base::mask vec[5];
+   for (std::size_t i = 0; i < 5; ++i)
+     vec[i] = m00;
+  
+   called = 0;
+   dr.do_is(ctype_base::space, 'a');
+   VERIFY( called !=  1);
+ 
+   called = 0;
+   dr.do_is(lit, lit + 5, vec);
+   VERIFY( called !=  5);
+ 
+   called = 0;
+   dr.do_scan_is(ctype_base::space, lit, lit + 5);
+   VERIFY( called !=  10);
+ 
+   called = 0;
+   dr.do_scan_not(ctype_base::space, lit, lit + 5);
+   VERIFY( called !=  15);
+   
+   return 0;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]