This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7775: std::string foo = foo + "b" is erroneously compiled
- From: udbz at rz dot uni-karlsruhe dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Aug 2002 15:47:52 -0000
- Subject: c++/7775: std::string foo = foo + "b" is erroneously compiled
- Reply-to: udbz at rz dot uni-karlsruhe dot de
>Number: 7775
>Category: c++
>Synopsis: std::string foo = foo + "b" is erroneously compiled
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Aug 30 08:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: udbz@rz.uni-karlsruhe.de
>Release: gcc-3.0.3
>Organization:
>Environment:
>Description:
GCC is too permissive when it comes to initialization
with operator=(): It will even generate illegal code
on optimization-level -O3:
#include <iostream.h>
#include <string>
int main()
{
std::string foo = foo + "b";
std::cout << foo << endl;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: