This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55227] designated initializer for char array by string constant
- From: "jr at heisey dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Nov 2018 18:22:36 +0000
- Subject: [Bug c++/55227] designated initializer for char array by string constant
- Auto-submitted: auto-generated
- References: <bug-55227-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55227
J.R. Heisey <jr at heisey dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jr at heisey dot org
--- Comment #3 from J.R. Heisey <jr at heisey dot org> ---
struct S s1 = { { a : "aaaa" } };
struct S s2 = { { .a = "aaaa"} };
This compiles with 6.2.1 for ARM by Linaro.
You need separate braces around the array initializer to distinguish it from
the struct initializer.