This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12964] string literal is treated as "const char[]" in conditional expression
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Nov 2003 16:40:44 -0000
- Subject: [Bug c++/12964] string literal is treated as "const char[]" in conditional expression
- References: <20031108155344.12964.rdabrowa@poczta.onet.pl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-08 16:40 -------
ICC 6.0 also errors out:
pr12964.cc(5): error: a value of type "const char *" cannot be used to initialize an entity of
type "char *"
char *s = n ? "foo" : "bar";
^
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12964