Where's the constructor?

Alexandre Oliva oliva@dcc.unicamp.br
Wed Feb 11 06:50:00 GMT 1998


The Red Fox writes:

> Surely in this case the default constructor for String should be called
> in the absence of the return statement?

This is not required.  Falling off a function that does not return
void is undefined behavior.  Since it's impossible, in general, to
prove that a function will never fall off, it would be necessary to
generate calls to constructor at points where that would be
unnecessary.  egcs does The Right Thing (TM), IMHO.

-- 
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 mailing list