[Bug c++/12964] string literal is treated as "const char[]" in conditional expression

rdabrowa at poczta dot onet dot pl gcc-bugzilla@gcc.gnu.org
Sat Nov 8 17:51:00 GMT 2003


------- Additional Comments From rdabrowa at poczta dot onet dot pl  2003-11-08 17:51 -------
(In reply to comment #2)
> Yes, as required by the standard [lex.string]. 

OK sorry. But I have one more question.
Consider similar code:

void f()
{
    const int n = 1;
    char *s = n ? "foo" : "bar";
}

Copiler does not complain. Is this correct ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12964



More information about the Gcc-bugs mailing list