_M_fill initialization in basic_ios::init
Paolo Carlini
pcarlini@unitus.it
Fri Dec 7 01:27:00 GMT 2001
Richard Burkert wrote:
> #include <sstream>
>
> int main () {
> std::basic_stringstream<int> test;
> return 0;
> }
>
> ctype only has predefined specializations for char and wchar_t,
> so int just gets the generic version which apparently doesn't
> do it for whatever locale i'm in. See how it goes for you.
I agree with you: ctype has only has predefined specializations for char and
wchar_t. Ironically this issue is related to an old PR of mine, PR1704, in
particular Benjamin Kosnik wrote: "This is allowed (ctype<int>), but keep in
mind that the standard locale doesn't have ctype<int> as a standard facet, so
thus use_facet has to fail". And then: "This is, I believe, standard
conformant behavior. To use ctype<int>, you'd have to imbue it in the standard
locale (and then add some kind of ctype<int> functionality, which is of course
a bit of a job.)".
What's new wrt to my PR1704 is that you are experiencing a seg-fault, always
to be avoided! I notice here that, first blush, your problem seems also
related to PR3983.
I'l try to understand more of this in the next couple of days.
Thanks for your additional details and for the testcase!
Paolo.
More information about the Libstdc++
mailing list