This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- Additional Comments From gdr at integrable-solutions dot net  2003-11-08 20:50 -------
Subject: Re:  string literal is treated as "const char[]" in conditional expression

"rdabrowa at poczta dot onet dot pl" <gcc-bugzilla@gcc.gnu.org> writes:

| (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 ?

Compiler is right.  GCC message is actually meaningful and does
provide clue. 

-- Gaby


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]