This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/8716: std::string( NULL, 0 ) throws exception also on zero length
- From: pme at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, pme at gcc dot gnu dot org, x at zsch dot de
- Date: 26 Nov 2002 16:37:06 -0000
- Subject: Re: libstdc++/8716: std::string( NULL, 0 ) throws exception also on zero length
- Reply-to: pme at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, pme at gcc dot gnu dot org, x at zsch dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: std::string( NULL, 0 ) throws exception also on zero length
Responsible-Changed-From-To: unassigned->pme
Responsible-Changed-By: pme
Responsible-Changed-When: Tue Nov 26 08:37:05 2002
Responsible-Changed-Why:
I changed it.
State-Changed-From-To: open->feedback
State-Changed-By: pme
State-Changed-When: Tue Nov 26 08:37:05 2002
State-Changed-Why:
Thank you for your bug report.
I cannot reproduce this using 3.2.1:
% cat 8716.cc
#include <string>
using namespace std;
int main( int, char** )
{
try
{
const char* s = NULL;
string a = string( s, 0 );
printf( "ok\n" );
return 0;
}
catch( const exception& x ) { printf( "%s\n", x.what() ); return 1; }
}
% g++ 8716.cc
% ./a.out
ok
%
Can you try with the lastest release?
I suspect that the fix for 8347 also changed this behavior.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8716