Bitfield conversion bug in 4.2?

Ismail Dönmez ismail@pardus.org.tr
Mon Mar 19 21:48:00 GMT 2007


On Monday 19 March 2007 23:00:09 Eric Lemings wrote:
> 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?

It should be fixed in 4.2 branch now, see 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31157 .


-- 
Happiness in intelligent people is the rarest thing I know. (Ernest Hemingway)

Ismail Donmez ismail (at) pardus.org.tr
GPG Fingerprint: 7ACD 5836 7827 5598 D721 DF0D 1A9D 257A 5B88 F54C
Pardus Linux / KDE developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070319/47195127/attachment.sig>


More information about the Gcc mailing list