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]

2.95.2 failure of bitset operator[]


bitset operator[] fails in this:

#include <bitset>

int main()
{
  bitset<sizeof(int) * 8> bufWord;

  bufWord[3] = 0;
}


cd /home/jdonner/
gcc bittest.cpp -lstdc++
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/bitset:
In method `bitset<32,long unsigned
int>::reference::reference(bitset<32,long unsigned int> &, unsigned
int)':
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/bitset:753:  
instantiated from `bitset<32,long unsigned int>::operator [](unsigned
int)'
bittest.cpp:7:   instantiated from here
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/bitset:377:
`long unsigned int & _Base_bitset<1,long unsigned
int>::_M_getword(unsigned int)' is inaccessible
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/bitset:583:
within this context

Compilation exited abnormally with code 1 at Fri Nov  5 15:54:24


cd /home/jdonner/
gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)

Compilation finished at Fri Nov  5 15:56:15

......................

Incidentally, I have to link with -lstdc++ explicitly since messing up 
my installation (which has persisted through several complete
rebuilds).  
How can I restore gcc to linking with libstdc++ automatically?

Thanks,

Jeff

bitsetbug.tar.gz


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