bitset_members.cc: New test.

2002-04-09  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++/6124
	* testsuite/23_containers/bitset_members.cc: New test.
	* include/std/std_bitset.h (_Bit_count::_S_bit_count): Move..
	(_S_bit_count): Here.
	(_First_one::_S_first_one): Move...
	(_S_first_one): Here.
	Format.
	* src/bitset.cc: Adjust.
	* config/linker-map.gnu: Export.

From-SVN: r52066
This commit is contained in:
Benjamin Kosnik 2002-04-09 07:35:31 +00:00 committed by Benjamin Kosnik
parent e70ed0d9a5
commit 1cb7f91f86
5 changed files with 793 additions and 680 deletions

View File

@ -1,3 +1,15 @@
2002-04-09 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/6124
* testsuite/23_containers/bitset_members.cc: New test.
* include/std/std_bitset.h (_Bit_count::_S_bit_count): Move..
(_S_bit_count): Here.
(_First_one::_S_first_one): Move...
(_S_first_one): Here.
Format.
* src/bitset.cc: Adjust.
* config/linker-map.gnu: Export.
2002-04-08 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/5180

View File

@ -34,7 +34,9 @@ GLIBCPP_3.1 {
std::__basic_file*;
std::__num_base*;
std::__timepunct*;
std::__numeric_limits_base*
std::__numeric_limits_base*;
std::_S_bit_count;
std::_S_first_one
};
# Names not in an 'extern' block are mangled names.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Bitset definitions -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation
// Copyright (C) 2001, 2002 Free Software Foundation
//
// This file is part of GNU CC.
//
@ -59,7 +59,7 @@ std::_Base_bitset<1>::_M_do_find_first(std::size_t __not_found) const
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
return __j * CHAR_BIT + _S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
@ -93,7 +93,7 @@ std::_Base_bitset<1>::_M_do_find_next(std::size_t __prev,
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
return __j * CHAR_BIT + _S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
@ -103,11 +103,10 @@ std::_Base_bitset<1>::_M_do_find_next(std::size_t __prev,
return __not_found;
} // end _M_do_find_next
// ------------------------------------------------------------
// Lookup tables for find and count operations.
template<bool __dummy>
unsigned char std::_Bit_count<__dummy>::_S_bit_count[] = {
// Lookup tables for find and count operations.
unsigned char std::_S_bit_count[256] =
{
0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */
2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */
2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */
@ -160,10 +159,10 @@ unsigned char std::_Bit_count<__dummy>::_S_bit_count[] = {
6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */
6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */
8 /* 255 */
}; // end _Bit_count
}; // end _S_bit_count
template<bool __dummy>
unsigned char std::_First_one<__dummy>::_S_first_one[] = {
unsigned char std::_S_first_one[256] =
{
0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */
0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */
1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */
@ -216,12 +215,5 @@ unsigned char std::_First_one<__dummy>::_S_first_one[] = {
0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */
1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */
0, /* 255 */
}; // end _First_one
}; // end _S_first_one
// Explicitly instantiate them.
template unsigned char std::_Bit_count<false>::_S_bit_count[];
template unsigned char std::_Bit_count<true>::_S_bit_count[];
template unsigned char std::_First_one<false>::_S_first_one[];
template unsigned char std::_First_one<true>::_S_first_one[];

View File

@ -45,9 +45,16 @@ test01(void)
VERIFY( test );
}
// libstdc++/6124
void test02()
{
std::bitset<1> bs;
bs.count();
}
int main()
{
test01();
test02();
return 0;
}