From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: robert@physiol.med.tu-muenchen.de (Robert Wilhelm) Cc: Lassi.Tuura@cern.ch, neal@ctd.comsat.com, egcs@cygnus.com, g++@cygnus.com Subject: Re: 971127 array initialization problem!?! Date: Mon, 01 Dec 1997 11:32:00 -0000 Message-id: <199712011746.JAA26218@atrus.synopsys.com> References: <19971201112846.20776@haegar.physiol.med.tu-muenchen.de> X-SW-Source: 1997-12/msg00052.html > On Mon, Dec 01, 1997 at 08:52:19AM +0100, Lassi A. Tuura wrote: > > neal@ctd.comsat.com wrote: > > > QBitmap* y = new QBitmap[5](2,2); > > > > This is not valid C++ syntax -- initialisers are not allowed in > > array-new expression. Code like this used to compile with g++, but I > > don't know if it ever was officially supported GNU extension. If the > > feature has been removed, the diagnostic could be improved... > > > > Would the g++ maintainers accept patches to restore the old behavior? > > I have quite a lot of code which depends on > this unofficial behavior :-( I would advise against it. g++ can't carry baggage forever. I'd like for us to encourage people to write C++ and do a good job compiling it, rather than encourage them to write a different language called "g++". As for your "quite a lot of code", use vectors to get the same effect: vector y(5, QBitmap(2,2)); If you must have C arrays, you could use placement new to do the construction.