This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/37311] C frontend rejects __typeof__(bitfield).
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2008 11:59:39 -0000
- Subject: [Bug other/37311] C frontend rejects __typeof__(bitfield).
- References: <bug-37311-7667@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from joseph at codesourcery dot com 2008-09-01 11:59 -------
Subject: Re: New: C frontend rejects __typeof__(bitfield).
On Mon, 1 Sep 2008, pluto at agmk dot net wrote:
> $ cat x.c
> struct { int a:1; } bf;
> __typeof__(bf.a) clone;
>
> $ g++ -x c x.c -c
> x.c:2: error: 'typeof' applied to a bit-field
>
> this testcase was extracted from gnupg-1.4.9 sources.
> it works at least on gcc-3.2.3 (Red Hat Linux 3.2.3-53).
If you mean to report a C bug, use component "c"; for C++, component
"c++". For C this is a deliberate change to reject typeof on bit-fields
just as sizeof is rejected on bit-fields; see bug 10333. Your example
uses g++ and I don't know if it's a deliberate change for C++.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37311