This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ chokes on static char foo[]={"bar"};
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: C++ chokes on static char foo[]={"bar"};
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 2 Jun 2000 14:50:34 +0200
- Cc: gcc-bugs at gcc dot gnu dot org
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
C++ dies with initializer-string for array of chars is too long
even if the size of array is not specified:
static const char foo[] = {"bar"};
This works just fine in C and used to work with older C++ as well.
c-typeck.c digest_init allows this because it checks whether either
TYPE_DOMAIN is NULL_TREE in comptypes, but for C++ it seems like TYPE_DOMAIN
is always NULL, so I'm not sure how to fix this...
Jakub