This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14075] ("foo") accepted as char[] initializer
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2004 19:28:01 -0000
- Subject: [Bug c++/14075] ("foo") accepted as char[] initializer
- References: <20040208190047.14075.porten@kde.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-12-21 19:27 -------
Subject: Re: ("foo") accepted as char[] initializer
"nathan at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| 2004-12-16 Nathan Sidwell <nathan@codesourcery.com>
|
| PR c++/14075
| * decl.c (check_initializer): Check string initializer of array is
| not parenthesized.
| * cp-tree.h (PAREN_STRING_LITERAL_P): New.
| * semantics.c (finish_parenthesized_expr): Mark a STRING_CST.
| * error.c (dump_expr): <STRING_CST case> Add parens, if needed.
The change for error.c is wrong. It should have been in
gccp/c-pretty-print.c. And the flag should have been common to both C
and C++ too.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14075