This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix PR c++/28053


Hi,

The following testcase triggers a seg fault in the middle-end:

struct X {};

struct A
{
   X x : 2;
};

struct B : A {};

The attached fixes this by moving the diagnosis of non-integral
bitfields from check_bitfield_decl to grokbitfield, allowing the
invalid declaration to be discarded.

Bootstrapped and regression tested on i686-pc-linux-gnu, ok for mainline?

Cheers,
Lee.

:ADDPATCH c++:

2006-10-18 Lee Millward <lee.millward@codesourcery.com>

       PR c++/28053
       * class.c (check_bitfield_decl): Move check for bitfields
       with non integral type to...
       * decl2.c (grokbitfield): ...here.

2006-10-18 Lee Millward <lee.millward@codesourcery.com>

       PR c++/28053
       * g++.dg/parse/bitfield1.C: Adjust error markers.
       * g++.dg/parse/bitfield2.C: New test.

Attachment: pr28053.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]