[Patch] PR c++/44086

Fabien Chêne fabien.chene@gmail.com
Fri Jun 4 12:15:00 GMT 2010


2010/5/21 Jason Merrill <jason@redhat.com>:
> On 05/17/2010 03:03 PM, Fabien Chêne wrote:
>>
>> 2010-05-17  Fabien Chêne<fabien.chene@gmail.com>
>>        PR c++/44086
>>        * class.c (check_field_decls): Remove the check 'DECL_INITIAL (x)
>>        == NULL_TREE' before setting CLASSTYPE_READONLY_FIELDS_NEED_INIT,
>>        which was preventing uninitialized const bitfields members to be
>>        diagnosed. Same for SET_CLASSTYPE_REF_FIELDS_NEED_INIT.
>
> Hmm, I think we'll want that code for when we implement member initializers.
>  Does it work to just move the check_bitfield_decl/check_field_decl hunk up
> higher?

Yes, it works. OK for trunk ?

gcc/testsuite/ChangeLog:

2010-06-04  Fabien Chêne  <fabien@gcc.gnu.org>
	PR c++/44086
	* g++.dg/init/pr44086.C: New.
	* g++.dg/cpp0x/decltype4.C: Adjust.

gcc/cp/ChangeLog:

2010-06-04  Fabien Chêne  <fabien@gcc.gnu.org>
	PR c++/44086
	* class.c (check_field_decls): Move the call to
	check_bitfield_decl before trying to set the
	CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.

-- 
Fabien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44086.patch
Type: application/octet-stream
Size: 2169 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100604/bd0d9265/attachment.obj>


More information about the Gcc-patches mailing list