This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5452: The following code compiles. Why? MSVC++6 does not.
- From: neil 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, p dot klotz at icoserve dot com
- Date: 22 Jan 2002 16:37:03 -0000
- Subject: Re: c++/5452: The following code compiles. Why? MSVC++6 does not.
- Reply-to: neil 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, p dot klotz at icoserve dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: The following code compiles. Why? MSVC++6 does not.
State-Changed-From-To: open->analyzed
State-Changed-By: neil
State-Changed-When: Tue Jan 22 08:37:03 2002
State-Changed-Why:
I'm not an expert, but Comeau compiles this too, and if G++
and Comeau compile it, I tend to believe it's correct 8-)
I suspect the unary plus decays the string literal to a
pointer to const char, which then combines without problems
with the binary '+' of std::string after a conversion of
const char * to std::string. But I could be wrong 8-)
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5452