+2003-10-12 Paolo Carlini <pcarlini@unitus.it>
+
+ * config/locale/ieee_1003.1-2001/codecvt_specializations.h:
+ Change #ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS to a comment.
+ * include/bits/basic_string.tcc: Likewise.
+ * include/bits/ios_base.h: Likewise.
+ * include/bits/istream.tcc: Likewise.
+ * include/bits/locale_facets.tcc: Likewise.
+ * include/bits/ostream.tcc: Likewise.
+ * include/bits/stl_function.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_pair.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/streambuf_iterator.h
+ * include/std/std_iosfwd.h: Likewise.
+ * include/std/std_istream.h: Likewise.
+ * include/std/std_sstream.h: Likewise.
+ * include/std/std_streambuf.h: Likewise.
+ * src/ios.cc: Likewise.
+ * include/bits/c++config:
+ Comment out #define _GLIBCXX_RESOLVE_LIB_DEFECTS 1.
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Tweak a
+ dg-error directive due to removal of a blank line.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Likewise.
+
2003-10-12 Andreas Tobler <a.tobler@schweiz.ch>
Paolo Carlini <pcarlini@unitus.it>
const extern_type* __end, size_t __max) const
{ return std::min(__max, static_cast<size_t>(__end - __from)); }
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 74. Garbled text for codecvt::do_max_length
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 74. Garbled text for codecvt::do_max_length
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_max_length() const throw()
{ return 1; }
-#endif
+
_S_create(size_t __capacity, const _Alloc& __alloc)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
if (__capacity > _S_max_size)
-#else
- if (__capacity == npos)
-#endif
__throw_length_error("basic_string::_S_create");
// NB: Need an array of char_type[__capacity], plus a
//#define _GLIBCXX_DEPRECATED 1
// Use corrected code from the committee library group's issues list.
-#define _GLIBCXX_RESOLVE_LIB_DEFECTS 1
+//#define _GLIBCXX_RESOLVE_LIB_DEFECTS 1
// The remainder of the prewritten config is automatic; all the
// user hooks are listed above.
class failure : public exception
{
public:
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //48. Use of non-existent exception constructor
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 48. Use of non-existent exception constructor
explicit
failure(const string& __str) throw();
private:
string _M_msg;
-#endif
};
// 27.4.2.1.2 Type ios_base::fmtflags
protected:
ios_base();
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //50. Copy constructor and assignment operator of ios_base
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 50. Copy constructor and assignment operator of ios_base
private:
ios_base(const ios_base&);
ios_base&
operator=(const ios_base&);
-#endif
};
// [27.4.5.1] fmtflags manipulators
traits_type::to_char_type(__c)))
__c = __sb->snextc();
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//195. Should basic_istream::sentry's constructor ever set eofbit?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 195. Should basic_istream::sentry's constructor ever set eofbit?
if (traits_type::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
-#endif
}
}
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __l);
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
&& (numeric_limits<short>::min() <= __l
__n = __l;
else
__err |= ios_base::failbit;
-#endif
this->setstate(__err);
}
catch(...)
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __l);
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
&& (numeric_limits<int>::min() <= __l
__n = __l;
else
__err |= ios_base::failbit;
-#endif
this->setstate(__err);
}
catch(...)
basic_istream<_CharT, _Traits>::
putback(char_type __c)
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 60. What is a formatted input function?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
_M_gcount = 0;
-#endif
sentry __cerb(*this, true);
if (__cerb)
{
basic_istream<_CharT, _Traits>::
unget(void)
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 60. What is a formatted input function?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
_M_gcount = 0;
-#endif
sentry __cerb(*this, true);
if (__cerb)
{
// DR60. Do not change _M_gcount.
if (!this->fail())
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
-// 129. Need error indication from seekp() and seekg()
+ // 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(ios_base::failbit);
-#endif
}
return *this;
}
// DR60. Do not change _M_gcount.
if (!this->fail())
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
ios_base::in);
-// 129. Need error indication from seekp() and seekg()
+ // 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(ios_base::failbit);
-#endif
}
return *this;
}
if (_Traits::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//68. Extractors for char* should store null at end
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 68. Extractors for char* should store null at end
*__s = char_type();
-#endif
__in.width(0);
}
catch(...)
__in.setstate(ios_base::eofbit);
__in.width(0);
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//211. operator>>(istream&, string&) doesn't set failbit
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 211. operator>>(istream&, string&) doesn't set failbit
if (!__extracted)
__in.setstate (ios_base::failbit);
-#endif
return __in;
}
return __beg;
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //17. Bad bool parsing
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 17. Bad bool parsing
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
}
return __beg;
}
-#endif
template<typename _CharT, typename _InIter>
_InIter
_M_group_float(const string& __grouping, _CharT __sep, const _CharT* __p,
_CharT* __new, _CharT* __cs, int& __len) const
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //282. What types does numpunct grouping refer to?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 282. What types does numpunct grouping refer to?
// Add grouping, if necessary.
_CharT* __p2;
const int __declen = __p ? __p - __cs : __len;
__newlen += __len - __declen;
}
__len = __newlen;
-#endif
}
// The following code uses snprintf (or sprintf(), when
{
if (!this->fail())
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::out);
-// 129. Need error indication from seekp() and seekg()
+ // 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(ios_base::failbit);
-#endif
}
return *this;
}
{
if (!this->fail())
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekoff(__off, __d,
ios_base::out);
-// 129. Need error indication from seekp() and seekg()
+ // 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(ios_base::failbit);
-#endif
}
return *this;
}
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 167. Improper use of traits_type::length()
-// Note that this is only in 'Review' status.
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 167. Improper use of traits_type::length()
+ // Note that this is only in 'Review' status.
typedef char_traits<char> __traits_type;
-#endif
typename __ostream_type::sentry __cerb(__out);
if (__cerb && __s)
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(__str.size());
const _CharT* __s = __str.data();
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 25. String operator<< uses width() value wrong
-#endif
if (__w > __len)
{
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
operator()(const typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //109. Missing binders for non-const sequence elements
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
typename _Operation::result_type
operator()(typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
-#endif
};
/// One of the @link s20_3_6_binder binder functors@endlink.
operator()(const typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
- //109. Missing binders for non-const sequence elements
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
typename _Operation::result_type
operator()(typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
-#endif
};
/// One of the @link s20_3_6_binder binder functors@endlink.
size_type count(const key_type& __x) const { return _M_t.count(__x); }
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//214. set::find() missing const overload
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) {
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
-#else
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
- iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
- pair<iterator,iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
-#endif
template <class _K1, class _C1, class _A1>
friend bool operator== (const multiset<_K1,_C1,_A1>&,
_T1 first; ///< @c first is a copy of the first object
_T2 second; ///< @c second is a copy of the second object
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//265. std::pair::pair() effects overly restrictive
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 265. std::pair::pair() effects overly restrictive
/** The default constructor creates @c first and @c second using their
* respective default constructors. */
pair() : first(), second() {}
-#else
- pair() : first(_T1()), second(_T2()) {}
-#endif
+
/** Two objects may be passed to a @c pair constructor to be copied. */
pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
* the LWG by default.
*/
template <class _T1, class _T2>
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//181. make_pair() unintended behavior
+// _GLIBCXX_RESOLVE_LIB_DEFECTS
+// 181. make_pair() unintended behavior
inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y)
-#else
-inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
-#endif
{
return pair<_T1, _T2>(__x, __y);
}
return _M_t.find(__x) == _M_t.end() ? 0 : 1;
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-//214. set::find() missing const overload
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) {
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
-#else
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
- iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
- pair<iterator,iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
-#endif
template <class _K1, class _C1, class _A1>
friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
return __old;
}
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 110 istreambuf_iterator::equal not const
// NB: there is also number 111 (NAD, Future) pending on this function.
bool
bool __beof = traits_type::eq_int_type(__b._M_get(), __eof);
return (__thiseof && __beof || (!__thiseof && !__beof));
}
-#endif
private:
int_type
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class ostreambuf_iterator;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// Not included. (??? Apparently no LWG number?)
class ios_base;
-#endif
/**
* @defgroup s27_2_iosfwd I/O Forward Declarations
public basic_ostream<_CharT, _Traits>
{
public:
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 271. basic_iostream missing typedefs
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 271. basic_iostream missing typedefs
// Types (inherited):
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
-#endif
// Non-standard Types:
typedef basic_istream<_CharT, _Traits> __istream_type;
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 251. basic_stringbuf missing allocator_type
+ // _GLIBCXX_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;
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 251. basic_stringbuf missing allocator_type
+ // _GLIBCXX_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;
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 251. basic_stringbuf missing allocator_type
+ // _GLIBCXX_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;
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
-// 251. basic_stringbuf missing allocator_type
+ // _GLIBCXX_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;
}
#endif
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// Side effect of DR 50.
private:
basic_streambuf(const __streambuf_type&) { };
__streambuf_type&
operator=(const __streambuf_type&) { return *this; };
-#endif
};
} // namespace std
bool
ios_base::sync_with_stdio(bool __sync)
{
-#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 49. Underspecification of ios_base::sync_with_stdio
bool __ret = ios_base::Init::_S_synced_with_stdio;
-#endif
// Turn off sync with C FILE* for cin, cout, cerr, clog iff
// currently synchronized.
io1 = io2;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 747 }
+// { dg-error "is private" "" { target *-*-* } 746 }
// { dg-error "operator=" "" { target *-*-* } 0 }
test_base io2 = io1;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 744 }
+// { dg-error "is private" "" { target *-*-* } 743 }
// { dg-error "copy constructor" "" { target *-*-* } 0 }