------- Comment #9 from fabien dot chene at gmail dot com  2010-03-31 12:20 
-------
(In reply to comment #8)
> (N.B. your email to gcc-patches gives the wrong PR number in the subject.)
> 
> This reject the following valid program:
> 
> struct X {
>   X() : c(0), r(c) {}
>   const int c;
>   int const& r;
> };
> 
> int main()
> {
>   new X;
> }
> 
> If there is a default constructor it will be called, and so the members will
> not be uninitialized.

OK, I've revised the patch to check for a user defined constructor.
I have also added your testcase, and others dealing with arrays.

http://gcc.gnu.org/ml/gcc-patches/2010-03/msg01486.html


-- 


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

Reply via email to