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]

Bitfield conversion bug in 4.2?


Hi,
 
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 !

Is this a bug or new behavior?  If the latter, what is this attributed
to?
 
Thanks,
Eric.


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