------- Comment #15 from manu at gcc dot gnu dot org  2010-02-24 20:30 -------
(In reply to comment #12)
> Is there nothing pointed by this that could be initialized before calling the
> > constructor?
> 
> Nothing.

Then for sure someone can write a generic/gimple pass that detects this case
before lowering. Maybe it won't handle something more convoluted in the body of
the constructor, but at least mem-initializers will be warned. One only needs
to keep track which members have been initialized already, and if we use one
before it has been initialized, then warn. No dataflow needed. 

Alternatively, the C++ front-end could create an uninitialized variable for
each member variable. Initialize those, then, at the very end of the
constructor, assigned each clone variable to the appropriate member. This will
also enabled uninitialized warnings with the current infrastructure and it will
work in the body of the constructor.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808

Reply via email to