This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFH] Puzzling behaviour with a wstring constructor
- From: Nathan Myers <ncm at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 18 Mar 2003 14:50:12 -0800
- Subject: Re: [RFH] Puzzling behaviour with a wstring constructor
- References: <3E7787FB.9010606@unitus.it> <20030318210059.GH15175@tofu.dreamhost.com> <3E7789E5.4040209@unitus.it> <20030318220321.GI15175@tofu.dreamhost.com> <3E77992F.3040400@unitus.it>
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