c++/7775: std::string foo = foo + "b" is erroneously compiled

nathan@gcc.gnu.org nathan@gcc.gnu.org
Fri Aug 30 09:08:00 GMT 2002


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



More information about the Gcc-bugs mailing list