This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7775: std::string foo = foo + "b" is erroneously compiled
- From: nathan 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, udbz at rz dot uni-karlsruhe dot de
- Date: 30 Aug 2002 16:08:00 -0000
- Subject: Re: c++/7775: std::string foo = foo + "b" is erroneously compiled
- Reply-to: nathan 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, udbz at rz dot uni-karlsruhe dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: std::string foo = foo + "b" is erroneously compiled
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Fri Aug 30 09:07:58 2002
State-Changed-Why:
The code is ill-formed. No diagnostic is required.
string foo = foo + "b";
is equivalent to
string foo (string (foo.operator+ ("b"));
which calls string::operator+ on foo, before it has been
constructed
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7775