Hello,

Here the problem is that we were recursing even if there was a user
defined constructor. In fact, the check was only done at the top, not
in nested fields.
If there is a user defined constructor, uninitialized const or
reference members are diagnosed elsewhere.
Bootstraped and tested on x86_64-unknown-linux-gnu.

OK for trunk and 4.6 ?

gcc/cp/ChangeLog:

2011-05-07  Fabien Chêne  <fab...@gcc.gnu.org>
        PR c++/48859
        * init.c (diagnose_uninitialized_cst_or_ref_member_1): stop the
        recursion if there is user defined constructor.

gcc/testsuite/ChangeLog:

2001-05-07  Fabien Chêne  <fab...@gcc.gnu.org>
        PR c++/48859
        * g++.dg/init/pr48859.C: New.

-- 
Fabien

Attachment: pr48859.patch
Description: Binary data

Reply via email to