------- Comment #2 from schaub-johannes at web dot de 2010-08-28 14:39 -------
(In reply to comment #1)
> (In reply to comment #0)
> > Fails to compile, but should work:
> >
> > struct A {
> > char x[4];
> > A():x("bug") { }
> > };
> >
> > Error i get is:
> >
> > "main.cpp:3: error: array used as initializer"
> >
>
> Why do you think it should work?
> For example, the following equivalent code is invalid as well:
>
> char x [4] ("bug");
>
This code is equivalent and is valid. At least, I don't see the Standard
forbidding it. GCC is the only compiler I tested (comeau/edg, clang) that
rejects it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43453