C++ incompatability.
Alexandre Oliva
oliva@dcc.unicamp.br
Wed Sep 2 21:02:00 GMT 1998
Yoni Wexler <wexler@cfar.umd.edu> writes:
> I'm no C++ expert but i think that the following program should compile
> flawlessly:
It seems to me that it should not :-(
> main() {
^^ there's no implicit int rule in C++, but that's not the point :-)
> char A[3][3] = { {1,2,3}, {4,5,6}, {7,8,9} };
> char B[3][3] = A;
The Standard says that only an agregate (i.e., POD-classes and arrays)
that is a class can be initialized with a single expression
[dcl.init.aggr]/3
This rules out copy-construction of arrays.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list