Bug 6410 - Trouble with non-Ascii monetary symbols and wchar_t
Summary: Trouble with non-Ascii monetary symbols and wchar_t
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-22 10:26 UTC by pcarlini
Modified: 2003-07-25 17:33 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pcarlini 2002-04-22 10:26:01 UTC
Trying to fix the testsuite to work well with the new EURO localedata (present in glibc CVS, both 2.2 and mainline) exposed what seems to be a problem with non-Ascii monetary symbols and wchar_t.
This is a testcase:

#include <locale>
#include <sstream>
#include <cassert>

int main()
{
  using namespace std;
  typedef ostreambuf_iterator<wchar_t> iterator_type;

  locale loc_de("de_DE@euro");

  const wstring empty;
  const wstring digits1(L"720000000000");

  wostringstream oss;
  oss.imbue(loc_de);

  const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 

  oss.setf(ios_base::showbase);

  oss.str(empty);
  iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
  wstring result4 = oss.str();
  assert( result4 == L"7.200.000.000,00 \244");
}

Release:
3.1 20020417

Environment:
x86-linux, glibc2.2.5 (gnu locale model)
Comment 1 pcarlini 2002-04-22 10:26:01 UTC
Fix:
Most probably, the culprit is the use of mbsrtowcs in config/locale/gnu/monetary_members.cc, which actually needs an appropriate setlocale in order to deal correctly with non-Ascii chars.
Comment 2 Benjamin Kosnik 2002-05-06 07:54:31 UTC
Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-Why: Perhaps not really mine, but I'll pretend.
Comment 3 Benjamin Kosnik 2002-05-06 07:54:31 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: According to Ulrich's comments here:
    http://gcc.gnu.org/ml/libstdc++/2002-04/msg00244.html
    
    One solution would be to setlocale to de_DE@euro, for instance, in your testcase.
    
    I tried that, and it didn't work really well. Here's the patch I'm currently using. I don't really like it, one because it breaks the current library API, and two because it's not MT-safe. I think something like this might be useful just to the testsuites can be cleaned up, and then a solution for glibc 2.3/uselocale can be used (which won't break the API for 3.1)
    
    Sound like a plan?
    
    Here's the patch:
    
    2002-05-06  Benjamin Kosnik  <bkoz@redhat.com>
    
    	PR libstdc++/6410
    	* include/bits/locale_facets.h (moneypunct::moneypunct): Add const
    	char* name parameter.
    	* config/locale/gnu/monetary_members.cc: Use it.
    	* src/localename.cc (_Impl::_Impl(const char*, size_t)): Use it.
    
    Index: include/bits/locale_facets.h
    ===================================================================
    RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
    retrieving revision 1.43
    diff -c -p -r1.43 locale_facets.h
    *** include/bits/locale_facets.h	16 Apr 2002 00:45:25 -0000	1.43
    --- include/bits/locale_facets.h	6 May 2002 14:49:05 -0000
    *************** namespace std
    *** 1357,1364 ****
            { _M_initialize_moneypunct(); }
      
            explicit 
    !       moneypunct(__c_locale __cloc, size_t __refs = 0) : locale::facet(__refs)
    !       { _M_initialize_moneypunct(__cloc); }
      
            char_type
            decimal_point() const
    --- 1357,1365 ----
            { _M_initialize_moneypunct(); }
      
            explicit 
    !       moneypunct(__c_locale __cloc, const char* __name, size_t __refs = 0) 
    !       : locale::facet(__refs)
    !       { _M_initialize_moneypunct(__cloc, __name); }
      
            char_type
            decimal_point() const
    *************** namespace std
    *** 1438,1444 ****
      
            // For use at construction time only.
             void 
    !        _M_initialize_moneypunct(__c_locale __cloc = _S_c_locale);
          };
      
        template<typename _CharT, bool _Intl>
    --- 1439,1446 ----
      
            // For use at construction time only.
             void 
    !        _M_initialize_moneypunct(__c_locale __cloc = _S_c_locale, 
    ! 				const char* __name = NULL);
          };
      
        template<typename _CharT, bool _Intl>
    *************** namespace std
    *** 1455,1465 ****
      
        template<> 
          void
    !     moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc);
      
        template<> 
          void
    !     moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc);
      
      #ifdef _GLIBCPP_USE_WCHAR_T
        template<>
    --- 1457,1467 ----
      
        template<> 
          void
    !     moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
      
        template<> 
          void
    !     moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
      
      #ifdef _GLIBCPP_USE_WCHAR_T
        template<>
    *************** namespace std
    *** 1470,1480 ****
      
        template<> 
          void
    !     moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc);
      
        template<> 
          void
    !     moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc);
      #endif
      
        template<typename _CharT, bool _Intl>
    --- 1472,1484 ----
      
        template<> 
          void
    !     moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale, 
    ! 							const char*);
      
        template<> 
          void
    !     moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale, 
    ! 							 const char*);
      #endif
      
        template<typename _CharT, bool _Intl>
    Index: config/locale/gnu/monetary_members.cc
    ===================================================================
    RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/gnu/monetary_members.cc,v
    retrieving revision 1.2
    diff -c -p -r1.2 monetary_members.cc
    *** config/locale/gnu/monetary_members.cc	16 Apr 2002 00:45:18 -0000	1.2
    --- config/locale/gnu/monetary_members.cc	6 May 2002 14:49:06 -0000
    *************** namespace std
    *** 216,222 ****
      
        template<> 
          void
    !     moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc)
          {
            if (__cloc == _S_c_locale)
      	{
    --- 216,223 ----
      
        template<> 
          void
    !     moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
    ! 						     const char*)
          {
            if (__cloc == _S_c_locale)
      	{
    *************** namespace std
    *** 260,266 ****
      
        template<> 
          void
    !     moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc)
          {
            if (__cloc == _S_c_locale)
      	{
    --- 261,268 ----
      
        template<> 
          void
    !     moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
    ! 						      const char*)
          {
            if (__cloc == _S_c_locale)
      	{
    *************** namespace std
    *** 313,319 ****
      #ifdef _GLIBCPP_USE_WCHAR_T
        template<> 
          void
    !     moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc)
          {
            if (__cloc == _S_c_locale)
      	{
    --- 315,322 ----
      #ifdef _GLIBCPP_USE_WCHAR_T
        template<> 
          void
    !     moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
    ! 							const char* __name)
          {
            if (__cloc == _S_c_locale)
      	{
    *************** namespace std
    *** 331,336 ****
    --- 334,343 ----
            else
      	{
      	  // Named locale.
    + 	  // XXX Fix me. Switch to named locale so that mbsrtowcs will work.
    + 	  char* __old = strdup(setlocale(LC_ALL, NULL));
    + 	  setlocale(LC_ALL, __name);
    + 
      	  _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
      
      	  _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
    *************** namespace std
    *** 391,402 ****
      	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
      	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
      	  _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
      	}
          }
      
        template<> 
          void
    !     moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc)
          {
            if (__cloc == _S_c_locale)
      	{
    --- 398,414 ----
      	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
      	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
      	  _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
    + 
    + 	  // XXX
    + 	  setlocale(LC_ALL, __old);
    + 	  free(__old);
      	}
          }
      
        template<> 
          void
    !     moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc, 
    ! 							 const char* __name)
          {
            if (__cloc == _S_c_locale)
      	{
    *************** namespace std
    *** 414,419 ****
    --- 426,435 ----
            else
      	{
      	  // Named locale.
    + 	  // XXX Fix me. Switch to named locale so that mbsrtowcs will work.
    + 	  char* __old = strdup(setlocale(LC_ALL, NULL));
    + 	  setlocale(LC_ALL, __name);
    + 
      	  _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
      	  _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
      	  _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
    *************** namespace std
    *** 473,478 ****
    --- 489,498 ----
      	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
      	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
      	  _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
    + 
    + 	  // XXX
    + 	  setlocale(LC_ALL, __old);
    + 	  free(__old);
      	}
          }
      
    Index: src/localename.cc
    ===================================================================
    RCS file: /cvs/gcc/gcc/libstdc++-v3/src/localename.cc,v
    retrieving revision 1.26
    diff -c -p -r1.26 localename.cc
    *** src/localename.cc	16 Apr 2002 00:45:32 -0000	1.26
    --- src/localename.cc	6 May 2002 14:49:06 -0000
    *************** namespace std
    *** 132,139 ****
          _M_init_facet(new num_get<char>);
          _M_init_facet(new num_put<char>);
          _M_init_facet(new std::collate<char>(__cloc));
    !     _M_init_facet(new moneypunct<char, false>(__cloc));
    !     _M_init_facet(new moneypunct<char, true>(__cloc));
          _M_init_facet(new money_get<char>);
          _M_init_facet(new money_put<char>);
          _M_init_facet(new __timepunct<char>(__cloc, __s));
    --- 132,139 ----
          _M_init_facet(new num_get<char>);
          _M_init_facet(new num_put<char>);
          _M_init_facet(new std::collate<char>(__cloc));
    !     _M_init_facet(new moneypunct<char, false>(__cloc, __s));
    !     _M_init_facet(new moneypunct<char, true>(__cloc, __s));
          _M_init_facet(new money_get<char>);
          _M_init_facet(new money_put<char>);
          _M_init_facet(new __timepunct<char>(__cloc, __s));
    *************** namespace std
    *** 148,155 ****
          _M_init_facet(new num_get<wchar_t>);
          _M_init_facet(new num_put<wchar_t>);
          _M_init_facet(new std::collate<wchar_t>(__cloc));
    !     _M_init_facet(new moneypunct<wchar_t, false>(__cloc));
    !     _M_init_facet(new moneypunct<wchar_t, true>(__cloc));
          _M_init_facet(new money_get<wchar_t>);
          _M_init_facet(new money_put<wchar_t>);
          _M_init_facet(new __timepunct<wchar_t>(__cloc, __s));
    --- 148,155 ----
          _M_init_facet(new num_get<wchar_t>);
          _M_init_facet(new num_put<wchar_t>);
          _M_init_facet(new std::collate<wchar_t>(__cloc));
    !     _M_init_facet(new moneypunct<wchar_t, false>(__cloc, __s));
    !     _M_init_facet(new moneypunct<wchar_t, true>(__cloc, __s));
          _M_init_facet(new money_get<wchar_t>);
          _M_init_facet(new money_put<wchar_t>);
          _M_init_facet(new __timepunct<wchar_t>(__cloc, __s));
Comment 4 pcarlini 2002-05-06 17:08:05 UTC
From: Paolo Carlini <pcarlini@unitus.it>
To: bkoz@gcc.gnu.org,  bkoz@gcc.gnu.org,  gcc-bugs@gcc.gnu.org, 
 gcc-prs@gcc.gnu.org,  nobody@gcc.gnu.org,  pcarlini@unitus.it, 
 gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/6410: Trouble with non-Ascii monetary symbols and wchar_t
Date: Mon, 06 May 2002 17:08:05 +0200

 bkoz@gcc.gnu.org wrote:
 
 >Synopsis: Trouble with non-Ascii monetary symbols and wchar_t
 >
 >Responsible-Changed-From-To: unassigned->bkoz
 >Responsible-Changed-By: bkoz
 >Responsible-Changed-When: Mon May  6 07:54:31 2002
 >Responsible-Changed-Why:
 >    Perhaps not really mine, but I'll pretend.
 >
 No, no... Definitely yours! ;-)
 
 >State-Changed-From-To: open->analyzed
 >State-Changed-By: bkoz
 >State-Changed-When: Mon May  6 07:54:31 2002
 >State-Changed-Why:
 >    According to Ulrich's comments here:
 >    http://gcc.gnu.org/ml/libstdc++/2002-04/msg00244.html
 >    
 >    One solution would be to setlocale to de_DE@euro, for instance, in your testcase.
 >    
 >    I tried that, and it didn't work really well. Here's the patch I'm currently using. I don't really like it, one because it breaks the current library API, and two because it's not MT-safe. I think something like this might be useful just to the testsuites can be cleaned up, and then a solution for glibc 2.3/uselocale can be used (which won't break the API for 3.1)
 >    
 >    Sound like a plan?
 >
 
 Excellent! If you could read in my mind you would find exactly that 
 reasoning!
 
 Please commit this, and I will finish cleaning up 
 22_locale/money_*_members.cc, as agreed, in the next few days.
 
 Thanks!
 Paolo.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6410
 
 

Comment 5 pcarlini 2002-05-13 14:50:09 UTC
From: Paolo Carlini <pcarlini@unitus.it>
To: bkoz@gcc.gnu.org,  gcc-gnats@gcc.gnu.org,  gcc-prs@gcc.gnu.org, 
 pcarlini@unitus.it
Cc:  
Subject: Re: libstdc++/6410: Trouble with non-Ascii monetary symbols and wchar_t
Date: Mon, 13 May 2002 14:50:09 +0200

 2002-05-13 Update: the testcase turns out to be malformed:
 
     http://sources.redhat.com/ml/libc-alpha/2002-05/msg00076.html
 
 The problem is real, however, and fixed (at the cost of breaking the 
 API) by the patch above.
 
 Paolo.
 
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6410 
 
 

Comment 6 Benjamin Kosnik 2002-07-03 06:29:27 UTC
From: bkoz@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/6410
Date: 3 Jul 2002 06:29:27 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	bkoz@gcc.gnu.org	2002-07-02 23:29:26
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/config/locale/generic: monetary_members.cc 
 	libstdc++-v3/config/locale/gnu: monetary_members.cc 
 	libstdc++-v3/include/backward: strstream.h 
 	libstdc++-v3/include/bits: locale_facets.h 
 	libstdc++-v3/src: localename.cc 
 
 Log message:
 	2002-07-02  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/6410
 	* include/bits/locale_facets.h (moneypunct::moneypunct): Add const
 	char* name parameter.
 	* config/locale/gnu/monetary_members.cc: Use it.
 	* config/locale/generic/monetary_members.cc: Same.
 	* src/localename.cc (_Impl::_Impl(const char*, size_t)): Use it.
 	
 	* include/backward/strstream.h: Update date.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.1267&r2=1.1268
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/generic/monetary_members.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/gnu/monetary_members.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/backward/strstream.h.diff?cvsroot=gcc&r1=1.7&r2=1.8
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.h.diff?cvsroot=gcc&r1=1.43&r2=1.44
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/src/localename.cc.diff?cvsroot=gcc&r1=1.27&r2=1.28
 
Comment 7 Benjamin Kosnik 2002-07-03 09:13:48 UTC
State-Changed-From-To: analyzed->suspended
State-Changed-Why: This patch now in 3.2. Pathes to fixe this in 3.1 need glibc 2.3: when this is released this bug report should be re visited.
Comment 8 Jakub Jelinek 2002-07-26 23:23:46 UTC
From: jakub@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/6410
Date: 26 Jul 2002 23:23:46 -0000

 CVSROOT:	/cvs/gcc
 Module name:	egcs
 Branch: 	gcc-3_2-branch
 Changes by:	jakub@gcc.gnu.org	2002-07-26 16:23:45
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/cp         : ChangeLog 
 	gcc/testsuite  : ChangeLog 
 	libstdc++-v3   : ChangeLog 
 	gcc/cp         : class.c mangle.c rtti.c decl2.c cp-tree.h 
 	gcc/config/i386: i386.c 
 	gcc/config/mips: mips.c 
 	gcc            : c-decl.c 
 	libstdc++-v3   : configure.in configure 
 	libstdc++-v3/config/locale/generic: monetary_members.cc 
 	libstdc++-v3/config/locale/gnu: monetary_members.cc 
 	libstdc++-v3/src: localename.cc locale.cc 
 	libstdc++-v3/testsuite/22_locale: ctor_copy_dtor.cc 
 	libstdc++-v3/testsuite/24_iterators: iterator.cc 
 	libstdc++-v3/testsuite/27_io: iostream.cc istream.cc ostream.cc 
 	                              ostringstream_members.cc 
 	                              streambuf.cc stringbuf.cc 
 	                              stringstream.cc 
 	                              stringstream_members.cc filebuf.cc 
 	                              istream_unformatted.cc 
 	libstdc++-v3/include/bits: stl_deque.h locale_facets.h 
 	                           stl_iterator.h basic_ios.tcc 
 	                           sstream.tcc streambuf.tcc istream.tcc 
 	libstdc++-v3/include/std: std_istream.h std_streambuf.h 
 	libstdc++-v3/libsupc++: new 
 Added files:
 	gcc/testsuite/g++.dg/abi: layout1.C layout2.C mangle8.C rtti1.C 
 	gcc/testsuite/gcc.c-torture/execute: memset-3.c 
 	gcc/testsuite/gcc.dg: gnu89-init-2.c 
 	libstdc++-v3/testsuite/18_support: new_delete_placement.cc 
 	libstdc++-v3/testsuite/23_containers: deque_operators.cc 
 	libstdc++-v3/testsuite/27_io: fstream.cc ifstream.cc ios.cc 
 	                              istringstream.cc ofstream.cc 
 	                              ostringstream.cc 
 	                              streambuf_members.cc 
 	                              stringbuf_members.cc 
 
 Log message:
 	gcc/ChangeLog
 	
 	2002-07-24  Frank van der Linden  <fvdl@wasabisystems.com>
 	
 	PR optimization/7291
 	* config/i386/i386.c (ix86_expand_clrstr): Fix bzero alignment
 	problem on x86_64.
 	
 	2002-05-16  Jason Merrill  <jason@redhat.com>
 	
 	* config/mips/mips.c (mips_output_external): Don't do sdata
 	optimization for a variable with DECL_COMDAT set.
 	
 	2002-01-03  Jakub Jelinek  <jakub@redhat.com>
 	
 	* c-decl.c (build_compound_literal): Set decl TREE_READONLY from TYPE.
 	
 	* c-decl.c (build_compound_literal): Defer compound literal decls
 	until until file end to emit them only if they are actually used.
 	
 	gcc/cp/ChangeLog
 	
 	2002-07-17  Scott Snyder <snyder@fnal.gov>
 	
 	PR c++/7320
 	* rtti.c (get_tinfo_decl): Set DECL_COMDAT.
 	
 	2002-07-05  Nathan Sidwell  <nathan@codesourcery.com>
 	
 	Repair damage on weak-impared targets caused by my previous patch.
 	* cp-tree.h (import_export_tinfo): Add parameter.
 	* decl2.c (import_export_tinfo): Add parameter, post adjust
 	DECL_COMDAT.
 	* rtti.c (emit_tinfo_decl): DECL_COMDAT is (nearly) always setup by
 	import_export_tinfo.
 	
 	2002-06-30  Nathan Sidwell  <nathan@codesourcery.com>
 	
 	* cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ...
 	(CPTI_TYPE_INFO_PTR_TYPE): ... this.
 	(tinfo_decl_type): Replace with ...
 	(type_info_ptr_type): ... this.
 	(import_export_tinfo): Declare.
 	(tinfo_decl_p): Rename to ...
 	(unemitted_tinfo_decl_p): ... this.
 	* decl2.c (import_export_decl): Break out tinfo handling into ...
 	(import_export_tinfo): ... here. New function.
 	(finish_file): Adjust.
 	* rtti.c (TINFO_REAL_NAME): New macro.
 	(init_rtti_processing): Create the tinfo types.
 	(get_tinfo_decl_dynamic): Use type_info_ptr_type, get_tinfo_ptr.
 	(get_tinfo_decl): Adjust.
 	(get_tinfo_ptr): New function.
 	(get_type_id): Use it.
 	(tinfo_base_init): Create vtable decl here, if it doesn't exist.
 	(ptr_initializer): Use get_tinfo_ptr.
 	(ptm_initializer): Likewise.
 	(synthesize_tinfo_var): Break into ...
 	(get_pseudo_ti_init): ... this. Just create the initializer.
 	(get_pseudo_ti_desc): .. and this.
 	(create_real_tinfo_var): Remove.
 	(create_pseudo_type_info): Don't create the vtable decl here.
 	(get_vmi_pseudo_type_info): Remove.
 	(create_tinfo_types): Adjust.
 	(tinfo_decl_p): Rename to ...
 	(unemitted_tinfo_decl_p): ... here. Adjust.
 	(emit_tinfo_decl): Adjust. Create the initializer.
 	
 	2002-06-14  Jason Merrill  <jason@redhat.com>
 	
 	C++ ABI changes.
 	* class.c (build_base_field): Set DECL_PACKED.
 	(layout_class_type): Don't use tail padding of PODs.
 	* mangle.c (write_unqualified_name): Fix template conversion op
 	mangling.
 	
 	2002-05-18  Jason Merrill  <jason@redhat.com>
 	
 	PR c++/6611
 	* decl2.c (import_export_decl): If we clear
 	DECL_NOT_REALLY_EXTERN, make sure DECL_EXTERNAL is set.
 	
 	2002-05-14  Jason Merrill  <jason@redhat.com>
 	
 	* rtti.c (get_tinfo_decl): Don't call comdat_linkage.
 	Do set DECL_COMDAT.
 	(synthesize_tinfo_var): Take the public decl.
 	(create_real_tinfo_var): Likewise.  Check DECL_COMDAT.
 	(emit_tinfo_decl): Adjust.  Call import_export_decl.
 	* decl2.c (import_export_decl): Simplify tinfo decl handling.
 	
 	gcc/testsuite/ChangeLog
 	
 	2002-07-24  Roger Sayle  <roger@eyesopen.com>
 	
 	* gcc.c-torture/execute/memset-3.c: New testcase.
 	
 	2002-06-14  Jason Merrill  <jason@redhat.com>
 	
 	* g++.dg/abi/layout1.C: New test.
 	* g++.dg/abi/layout2.C: New test.
 	* g++.dg/abi/mangle8.C: New test.
 	
 	2002-05-14  Jason Merrill  <jason@redhat.com>
 	
 	* g++.dg/abi/rtti1.C: New test.
 	
 	2002-01-03  Jakub Jelinek  <jakub@redhat.com>
 	
 	* gcc.dg/gnu89-init-2.c: New test.
 	
 	libstdc++-v3/ChangeLog
 	
 	2002-07-26  Phil Edwards  <pme@gcc.gnu.org>
 	
 	* libsupc++/new (placement delete):  Remove unused paramater names.
 	
 	2002-07-25  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/7216
 	* include/std/std_istream.h (basic_iostream): Add typedefs for
 	char_type, int_type, pos_type, off_type, and traits_type.
 	* testsuite/27_io/iostream.cc (test01): Add typedef tests.
 	* testsuite/27_io/istream.cc: Same.
 	* testsuite/27_io/ostream.cc: Same.
 	* testsuite/27_io/filebuf.cc: Same.
 	* testsuite/27_io/stringbuf.cc: Replace content, move to...
 	* testsuite/27_io/stringbuf_members.cc: ...here.
 	* testsuite/27_io/streambuf.cc: Replace content, move to...
 	* testsuite/27_io/streambuf_members.cc: ...here.
 	* testsuite/27_io/stringstream.cc: Replace content, move to...
 	* testsuite/27_io/stringstream_members.cc: ...here.
 	* testsuite/27_io/ios.cc: New file.
 	* testsuite/27_io/fstream.cc: New file.
 	* testsuite/27_io/ifstream.cc: New file.
 	* testsuite/27_io/ofstream.cc: New file.
 	* testsuite/27_io/istringstream.cc: New file.
 	* testsuite/27_io/ostringstream.cc: New file.
 	
 	2002-07-25  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/7220
 	* include/bits/istream.tcc (istream::ignore): Don't extract on
 	zero.
 	* testsuite/27_io/istream_unformatted.cc (test10): Add.
 	
 	2002-07-24  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/7222
 	* src/locale.cc (locale::locale(const char*)): Use setlocale NULL.
 	* testsuite/22_locale/ctor_copy_dtor.cc (test02): New.
 	
 	2002-07-24  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/7286
 	* libsupc++/new: Add placement delete.
 	* testsuite/18_support/new_delete_placement.cc: New.
 	
 	2002-07-07  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/7186
 	* include/bits/stl_deque.h (_Deque_iterator::operator-):
 	Make non-member, as already happens for the comparison
 	operators in accord with DR179 (Ready).
 	* testsuite/23_containers/deque_operators.cc: Add test02.
 	
 	2002-07-04  Benjamin Kosnik  <bkoz@redhat.com>
 	Jack Reeves  <jackw_reeves@hotmail.com>
 	
 	* include/std/std_streambuf.h (basic_streambuf::_M_buf): Change to
 	size_t, from int_type.
 	(basic_streambuf::_M_buf_size_opt): Same.
 	(basic_streambuf::_S_pback_sizex): Same.
 	* include/bits/streambuf.tcc: Same.
 	* include/std/std_streambuf.h (basic_streambuf::snextc): Use
 	eq_int_type.
 	(basic_streambuf::uflow): Same.
 	* include/bits/sstream.tcc (basic_stringbuf::overflow): Use
 	to_char_type.
 	* include/bits/basic_ios.tcc (basic_ios::init): Use _CharT().
 	* include/bits/streambuf.tcc (basic_streambuf::xsgetn): Use
 	eq_int_type.
 	(basic_streambuf::xsputn): Same.
 	(__copy_streambufs): Same.
 	
 	2002-07-02  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/6642
 	* include/bits/stl_iterator.h
 	(__normal_iterator::operator-(const __normal_iterator&)):
 	Make non-member, as already happens for the comparison
 	operators in accord with DR179 (Ready).
 	* testsuite/24_iterators/iterator.cc: Add test from the PR.
 	
 	2002-07-02  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	PR libstdc++/6410
 	* include/bits/locale_facets.h (moneypunct::moneypunct): Add const
 	char* name parameter.
 	* config/locale/gnu/monetary_members.cc: Use it.
 	* config/locale/generic/monetary_members.cc: Same.
 	* src/localename.cc (_Impl::_Impl(const char*, size_t)): Use it.
 	
 	2002-07-01  Benjamin Kosnik  <bkoz@redhat.com>
 	
 	* configure.in (libtool_VERSION): Bump to 5:0:0.
 	* configure: Regenerate.
 	
 	2002-05-19  Paolo Carlini  <pcarlini@unitus.it>
 	
 	* testsuite/23_containers/deque_operators.cc (test01):
 	Fix minor typo in last commit.
 	
 	2002-05-18  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/6503
 	* include/bits/stl_deque.h (_Deque_iterator::operator==,
 	operator!=, operator<, operator>, operator>=, operator<=):
 	Make non-member functions, to allow comparing const and
 	non-const iterators in any order.
 	* testsuite/23_containers/deque_operators.cc: New testfile.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657&r2=1.13152.2.657.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114&r2=1.2685.2.114.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166&r2=1.1672.2.166.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1057.2.159&r2=1.1057.2.159.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.436.2.10&r2=1.436.2.10.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/mangle.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.44.2.5&r2=1.44.2.5.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.130&r2=1.130.6.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.520.2.7&r2=1.520.2.7.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.681.2.12&r2=1.681.2.12.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.368.2.19&r2=1.368.2.19.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/config/mips/mips.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.176.2.6&r2=1.176.2.6.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/g++.dg/abi/layout1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.6.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/g++.dg/abi/layout2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.6.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/g++.dg/abi/mangle8.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.6.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/g++.dg/abi/rtti1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.2.8.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/gcc.c-torture/execute/memset-3.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/gcc.dg/gnu89-init-2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.300.2.10&r2=1.300.2.10.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/configure.in.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.83.2.14&r2=1.83.2.14.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/configure.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.235.2.24&r2=1.235.2.24.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/config/locale/generic/monetary_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1.2.2&r2=1.1.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/config/locale/gnu/monetary_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1.2.2&r2=1.1.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/src/localename.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.24.2.3&r2=1.24.2.3.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/src/locale.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.54.2.6&r2=1.54.2.6.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/18_support/new_delete_placement.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13&r2=1.13.12.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/23_containers/deque_operators.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.3.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/24_iterators/iterator.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.5&r2=1.5.14.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/fstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ifstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ios.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/istringstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ofstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ostringstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/streambuf_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/stringbuf_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/iostream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1&r2=1.1.24.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/istream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.4&r2=1.4.12.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ostream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.4&r2=1.4.12.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/ostringstream_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2&r2=1.2.20.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/streambuf.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.10.8.1&r2=1.10.8.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/stringbuf.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.7.2.1&r2=1.7.2.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/stringstream.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.8&r2=1.8.12.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/stringstream_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2&r2=1.2.20.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/filebuf.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.18&r2=1.18.12.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/testsuite/27_io/istream_unformatted.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.15.14.2&r2=1.15.14.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/stl_deque.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.17.8.2&r2=1.17.8.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/locale_facets.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.41.2.2&r2=1.41.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/stl_iterator.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.19.2.1&r2=1.19.2.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/basic_ios.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.11.2.3&r2=1.11.2.3.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/sstream.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.8.2.2&r2=1.8.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/streambuf.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.12.2.2&r2=1.12.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/bits/istream.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.24.2.6&r2=1.24.2.6.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/std/std_istream.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.3&r2=1.3.14.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/include/std/std_streambuf.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.5.2.2&r2=1.5.2.2.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libstdc++-v3/libsupc++/new.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.9.2.2&r2=1.9.2.2.2.1
 
Comment 9 Paolo Carlini 2002-10-27 03:06:50 UTC
State-Changed-From-To: suspended->closed
State-Changed-Why: Now fixed both 3_2-branch and mainline.