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]

Bug in g++2.95.1 syntax parsing(not exists in g++2.7.2.3)


------------------------------------------------------------------------
Test file(bitfields.cc):
------------------------------------------------------------------------
        #include <list.h>

        enum MsgType {
                MSG_DATA,
        };

        class C {
        public:
                MsgType mType : 8;
        };

        extern list<C> clist;

        int main(void)
        {
                list<C>::iterator ci = clist.begin();
                C& c = *ci;

                c.mType = MSG_DATA;     // no problem hear
                if ( c.mType != MSG_DATA )      // syntax error here ???
                        return -1;

                return 0;
        }


------------------------------------------------------------------------
Compiling command and output:
------------------------------------------------------------------------
% g++ -c bitfield.cc
bitfield.cc: In function `int main()':
bitfield.cc:20: attempt to take address of bit-field structure member
`C::mType'


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