This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [RFH] Puzzling behaviour with a wstring constructor


On Tue, Mar 18, 2003 at 11:09:51PM +0100, Paolo Carlini wrote:
> ... we have in the testsuite this embarassing situation, where
> 
>    string s(10, 0);
> 
> links and
> 
>    wstring s(10, 0);
> 
> doesn't.
> From a practical standpoint, what do you think we should do?

If you look at 21.3.1 paragraph 15, it says that when the template
argument matches an integral type (as above) it's equivalent to

  wstring s(static_cast<size_type>(10), static_cast<value_type>(0));

That does have to work.  I'm surprised that whatever was done for
string doesn't work for wstring.  Looking at bits/basic_string.h,
starting at line 746 (search for "21.3.1 para 15") we have an 
_S_construct_aux(..., __true_type) that should be called.

Looking back at the error message, that seems to be precisely what the 
linker is saying it can't find.  It's declared in the .h file, and 
defined in the .tcc file.  Looks to me like a compiler or linker bug.

Nathan Myers
ncm-nospam at cantrip dot org


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