This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in egcs-1.1


Martin Rehwald <rehwald@uni-muenster.de> writes:

> int main(int i) { char* s=new char[i+1](' '); }

> egcserrtst2.cpp: In function `int main(int)':
> egcserrtst2.cpp:3: request for member `__ct' in `*{anon}', which is of non-aggregate type `char'        

The error message could certainly be improved, but the code is really
incorrect.  new expressions of array types cannot contain non-default
initializers.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]