This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Address of bitfields
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Address of bitfields
- From: Dominik Strasser <dominik dot strasser at mchp dot siemens dot de>
- Date: Thu, 28 Oct 1999 16:06:36 +0200
- Organization: Siemens AG, ZT SE 4
Hello,
The program below is rejected by gcc 2.95.1 with the following messages:
b.C: In method `void A::foo()':
b.C:7: attempt to take address of bit-field structure member `A::s'
template <class _Tp> bool operator!=(const _Tp&, const _Tp&);
struct A {
enum {R} s: 8;
void foo() {
if( s==R ) return;
if( s!=R ) return;
}
};
ISO/IEC 14882:1998(E) 9.6 clause 3 states, that in this case a temporary
should have been inserted and the above code is correct.
Dominik
--
Dominik Strasser | Phone: +49 89 636-43691
SIEMENS AG | Fax: +49 89 636-42284
ZT SE 4 | E-Mail:Dominik.Strasser@mchp.siemens.de
Otto-Hahn-Ring 6 |
D-81739 Muenchen |