[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo at gcc dot gnu dot org


--- Comment #7 from paolo at gcc dot gnu dot org  2008-12-02 15:04 ---
Subject: Bug 38365

Author: paolo
Date: Tue Dec  2 15:02:53 2008
New Revision: 142358

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142358
Log:
2008-12-02  Paolo Carlini  <[EMAIL PROTECTED]>

PR libstdc++/38365 (cont)
* src/localename.cc (locale::locale(const locale&, const locale&,
category)): Revert last changes.
* src/localename.cc (locale::_Impl::_M_replace_categories(const
_Impl*, category)): Fix here instead; rework.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/src/localename.cc


-- 


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo dot carlini at oracle dot com


--- Comment #6 from paolo dot carlini at oracle dot com  2008-12-02 13:34 
---
(In reply to comment #5)
> (In reply to comment #4)
> > Your patch fixes the problem at the level of the locale constructor, but 
> > why do
> > not fix this problem at the level of  _M_replace_categories() instead? 
> 
> Because that would not work, _M_impl has already a name ("C") by that time.

Sorry, now I see that the involved _Impl constructor clones, thus creates an
unnamed clone if the original one is unnamed, thus the idea can work.


-- 


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo dot carlini at oracle dot com


--- Comment #5 from paolo dot carlini at oracle dot com  2008-12-02 13:21 
---
(In reply to comment #4)
> Your patch fixes the problem at the level of the locale constructor, but why 
> do
> not fix this problem at the level of  _M_replace_categories() instead? 

Because that would not work, _M_impl has already a name ("C") by that time. 
Note that all these classes are suboptimal performance-wise, will be redesigned
for the next ABI.


-- 


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread tsyvarev at ispras dot ru


--- Comment #4 from tsyvarev at ispras dot ru  2008-12-02 13:04 ---
According to the code, locale constructor calls

void locale::_Impl::_M_replace_categories(const _Impl* __imp, category __cat)

which already processes names of locales. This function works correctly, when
both locales (*this and __impl) have names, or when *this locale hasn't name.
But when *this locale has name, but __imp hasn't, the function doesn't clear
name of *this.

Your patch fixes the problem at the level of the locale constructor, but why do
not fix this problem at the level of  _M_replace_categories() instead? 


-- 


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo dot carlini at oracle dot com


--- Comment #3 from paolo dot carlini at oracle dot com  2008-12-02 10:59 
---
Fixed for 4.4.0.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.4.0
Version|unknown |4.3.0


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo at gcc dot gnu dot org


--- Comment #2 from paolo at gcc dot gnu dot org  2008-12-02 10:58 ---
Subject: Bug 38365

Author: paolo
Date: Tue Dec  2 10:57:22 2008
New Revision: 142349

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142349
Log:
2008-12-02  Paolo Carlini  <[EMAIL PROTECTED]>

PR libstdc++/38365
* src/localename.cc (locale::locale(const locale&, const locale&,
category)): Fix.
* testsuite/22_locale/locale/cons/38365.cc: New.

Added:
trunk/libstdc++-v3/testsuite/22_locale/locale/cons/38365.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/src/localename.cc


-- 


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



[Bug libstdc++/38365] Locale, constructed from named and unnamed locales, become named

2008-12-02 Thread paolo dot carlini at oracle dot com


--- Comment #1 from paolo dot carlini at oracle dot com  2008-12-02 09:53 
---
Ok.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
   |dot org |dot com
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-12-02 09:53:15
   date||


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