This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31273] New: Erroneous bitfield conversions to boolean values
- From: "eric dot lemings at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2007 23:05:31 -0000
- Subject: [Bug c/31273] New: Erroneous bitfield conversions to boolean values
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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