[v3] libstdc++/3139/3140/3141/3142
Benjamin Kosnik
bkoz@redhat.com
Tue Jun 12 15:13:00 GMT 2001
All this stuff is relatively minor, but important to get right. The
changes are minimal, the difference is stricter compatibilty with the
standard.
Mark, I'd like to check this in to the branch as well.
tested x86/linux
tested x86/linux x powerpc-eabism
tested powerpc/linux
2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/3142
* include/bits/std_sstream.h: Add allocator_type, as per DR 251.
libstdc++/3141
* include/bits/istream.tcc (getline, get): Fix as per DR 243.
libstdc++/3140
* include/bits/std_bitset.h (bitset::set): Fix as per DR 186.
libstdc++/3139
* include/bits/limits_generic.h: Fix as per DR 184.
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.16
diff -c -p -r1.16 istream.tcc
*** istream.tcc 2001/06/11 19:20:19 1.16
--- istream.tcc 2001/06/12 22:09:42
*************** namespace std
*** 570,576 ****
__throw_exception_again;
}
}
! *__s = char_type(NULL);
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
--- 570,576 ----
__throw_exception_again;
}
}
! *__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
*************** namespace std
*** 670,676 ****
__throw_exception_again;
}
}
! *__s = char_type(NULL);
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
--- 670,676 ----
__throw_exception_again;
}
}
! *__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
Index: include/bits/limits_generic.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/limits_generic.h,v
retrieving revision 1.2
diff -c -p -r1.2 limits_generic.h
*** limits_generic.h 2001/02/19 18:52:24 1.2
--- limits_generic.h 2001/06/12 22:09:44
*************** namespace std {
*** 117,124 ****
static bool max() throw()
{ return true; }
! static const int digits = 8;
! static const int digits10 = 2;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
--- 117,124 ----
static bool max() throw()
{ return true; }
! static const int digits = 1;
! static const int digits10 = 0;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
*************** namespace std {
*** 148,156 ****
static bool denorm_min() throw()
{ return static_cast<bool>(0); }
! static const bool is_iec559 = true;
static const bool is_bounded = true;
! static const bool is_modulo = true;
static const bool traps = false;
static const bool tinyness_before = false;
--- 148,156 ----
static bool denorm_min() throw()
{ return static_cast<bool>(0); }
! static const bool is_iec559 = false;
static const bool is_bounded = true;
! static const bool is_modulo = false;
static const bool traps = false;
static const bool tinyness_before = false;
Index: include/bits/std_bitset.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_bitset.h,v
retrieving revision 1.7
diff -c -p -r1.7 std_bitset.h
*** std_bitset.h 2001/06/04 17:42:22 1.7
--- std_bitset.h 2001/06/12 22:09:46
*************** public:
*** 551,564 ****
return *this;
}
! bitset<_Nb>& set(size_t __pos) {
! if (__pos >= _Nb)
! __STL_THROW(out_of_range("bitset"));
!
! return _Unchecked_set(__pos);
! }
!
! bitset<_Nb>& set(size_t __pos, int __val) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
--- 551,557 ----
return *this;
}
! bitset<_Nb>& set(size_t __pos, bool __val = true) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
Index: include/bits/std_sstream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_sstream.h,v
retrieving revision 1.6
diff -c -p -r1.6 std_sstream.h
*** std_sstream.h 2001/05/24 23:09:53 1.6
--- std_sstream.h 2001/06/12 22:09:47
*************** namespace std
*** 48,53 ****
--- 48,57 ----
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+ #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ #endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
*************** namespace std
*** 194,199 ****
--- 198,207 ----
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+ #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ #endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
*************** namespace std
*** 245,250 ****
--- 253,262 ----
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+ #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ #endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
*************** namespace std
*** 296,301 ****
--- 308,317 ----
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+ #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ #endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
*************** namespace std
*** 349,352 ****
#endif
#endif // _CPP_SSTREAM
-
--- 365,367 ----
More information about the Gcc-patches
mailing list