c++/5452: The following code compiles. Why? MSVC++6 does not.

neil@gcc.gnu.org neil@gcc.gnu.org
Tue Jan 22 08:37:00 GMT 2002


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



More information about the Gcc-prs mailing list