Bug 28053 - [4.2 regression] ICE deriving from class with invalid bitfield
Summary: [4.2 regression] ICE deriving from class with invalid bitfield
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P4 normal
Target Milestone: 4.2.0
Assignee: Lee Millward
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-06-16 02:55 UTC by Volker Reichelt
Modified: 2006-10-20 20:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-10-18 14:48:20


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-06-16 02:55:42 UTC
The following invalid code snippet causes an ICE on mainline:

============================================
struct X {};

struct A
{
    X x : 2;
};

struct B : A {};
============================================

bug.cc:5: error: bit-field 'X A::x' with non-integral type
bug.cc:8: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

This is a very recent regression (GCC 4.2.0 20060527 was not affected).
Comment 1 Janis Johnson 2006-08-12 21:25:12 UTC
A regression hunt on powerpc-linux identified this patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=114245

    r114245 | mmitchel | 2006-05-30 21:25:02 +0000 (Tue, 30 May 2006)
Comment 2 Volker Reichelt 2006-08-14 19:06:00 UTC
Reproduced by Janis.
Comment 3 patchapp@dberlin.org 2006-10-18 14:50:27 UTC
Subject: Bug number PR c++/28053

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00913.html
Comment 4 Lee Millward 2006-10-20 20:13:51 UTC
Subject: Bug 28053

Author: lmillward
Date: Fri Oct 20 20:13:42 2006
New Revision: 117910

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117910
Log:
        PR c++/28053
        * decl2.c (grokbitfield): Detect invalid non-integral 
        types earlier when possible.

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


Added:
    trunk/gcc/testsuite/g++.dg/parse/bitfield2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/bitfield1.C

Comment 5 Lee Millward 2006-10-20 20:14:40 UTC
Fixed in 4.2.