new type (initializer) --- bug ???

Alexandre Oliva oliva@dcc.unicamp.br
Sat Oct 31 04:38:00 GMT 1998


Ruediger Schopper <schopper@hal15.usm.uni-muenchen.de> writes:

> When one gives an initializer to the new operator, it
> compiles with aggregate types, but not with built in ones.

First of all, I should tell you that this is not Standard C++; it is
an extension provided by g++, so you'd better not rely on that.  If
you compile with -ansi -pedantic, you'll get error messages for those
usages.  However, for simmetry, egcs should provide the extension for
all types or for none, so I added the attached testcase to the
testsuite.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
// Build don't link:
// Special g++ Options:

int *foo = new int[1](0); // gets bogus error - XFAIL *-*-*


More information about the Gcc-bugs mailing list