This is the mail archive of the gcc-bugs@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]

[Bug c/31273] New: Erroneous bitfield conversions to boolean values


The following code compiles fine in GCC 4.1.

        enum E { e };
        struct S {
          E v:5;
        };
        S s;
        int main() { if (!s.v) return 0; }

In 4.2 (20070307), it gives the following error:

        test.cpp: In function 'int main()':
        test02.cpp:6: error: could not convert 's.S::v' to 'bool'
        test02.cpp:6: error: in arguument to unary !

Jim Wilson has suggested this is a bug due to recent patches to the 4.2 branch.


-- 
           Summary: Erroneous bitfield conversions to boolean values
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric dot lemings at roguewave dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31273


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