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]

Address of bitfields


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	|

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