C++ Patch for PR c++/48859
Fabien Chêne
fabien.chene@gmail.com
Sun May 8 13:07:00 GMT 2011
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 <fabien@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 <fabien@gcc.gnu.org>
PR c++/48859
* g++.dg/init/pr48859.C: New.
--
Fabien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr48859.patch
Type: application/octet-stream
Size: 860 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110508/6235bd74/attachment.obj>
More information about the Gcc-patches
mailing list