[PATCH] Fix libstdc++/8347

Paolo Carlini pcarlini@unitus.it
Fri Oct 25 09:34:00 GMT 2002


Hi again,

here is my proposal, as anticipated.

The idea is the following: in _S_construct we throw for a NULL
__beg only *after* having considered the possibility __beg == __end.

This is almost all, only we have to tweak the constructor
string(const _CharT*, const _Alloc&) not to pass to
_S_construct a pair of NULLs when its first argument is a NULL,
since we *want* to raise an exception in this specific case!

Tested x86-Linux.

Ok?

Ciao, Paolo.

2002-10-25  Paolo Carlini  <pcarlini@unitus.it>

        PR libstdc++/8347
        * include/bits/basic_string.tcc
        (string::_S_construct(_InIter, _InIter, const _Alloc&,
        forward_iterator_tag)): Do not throw logic error if
        __beg == NULL && __end == __beg.
        (string::string(const _CharT*, const _Alloc&)): Tweak.
        * testsuite/21_strings/ctor_copy_dtor.cc: Add test05 from PR.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_8347
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20021025/fad714ea/attachment.ksh>


More information about the Libstdc++ mailing list