Commit 42ca0438 by Benjamin Kosnik Committed by Benjamin Kosnik

concept-inst.cc (vector<locale::facet*>): Remove instantiations.


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

	* src/concept-inst.cc (vector<locale::facet*>): Remove instantiations.
	* src/stl-inst.cc (vector::_M_insert_aux): Remove instantiation.
	(__malloc_alloc_template): Conditionalize.

	* include/bits/istream.tcc: Remove sputbackc calls.

	* testsuite/19_diagnostics/stdexceptions.cc: Fix comment.

From-SVN: r52405
parent c0fe1b1d
2002-04-16 Benjamin Kosnik <bkoz@redhat.com>
* src/concept-inst.cc (vector<locale::facet*>): Remove instantiations.
* src/stl-inst.cc (vector::_M_insert_aux): Remove instantiation.
(__malloc_alloc_template): Conditionalize.
* include/bits/istream.tcc: Remove sputbackc calls.
* testsuite/19_diagnostics/stdexceptions.cc: Fix comment.
2002-04-16 Paolo Carlini <pcarlini@unitus.it> 2002-04-16 Paolo Carlini <pcarlini@unitus.it>
* testsuite/24_iterators/rel_ops.cc: New test. * testsuite/24_iterators/rel_ops.cc: New test.
2002-04-16 Gabriel Dos Reis <gdr@merlin.codesourcery.com> 2002-04-16 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
......
...@@ -579,28 +579,22 @@ namespace std ...@@ -579,28 +579,22 @@ namespace std
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__cerb && __n > 1) if (__cerb)
{ {
try try
{ {
const int_type __idelim = traits_type::to_int_type(__delim); const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof(); const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf(); __streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc(); int_type __c = __sb->sgetc();
bool __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
while (_M_gcount < __n - 1 && !__testeof && !__testdelim) while (_M_gcount + 1 < __n && __c != __eof && __c != __idelim)
{ {
*__s++ = traits_type::to_char_type(__c); *__s++ = traits_type::to_char_type(__c);
__c = __sb->snextc();
++_M_gcount; ++_M_gcount;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
} }
if (__testdelim || _M_gcount == __n - 1) if (__c == __eof)
__sb->sputbackc(__c);
if (__testeof)
this->setstate(ios_base::eofbit); this->setstate(ios_base::eofbit);
} }
catch(exception& __fail) catch(exception& __fail)
...@@ -627,35 +621,29 @@ namespace std ...@@ -627,35 +621,29 @@ namespace std
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__cerb) if (__cerb)
{ {
int_type __c;
__streambuf_type* __this_sb = this->rdbuf();
try try
{ {
const int_type __idelim = traits_type::to_int_type(__delim); const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof(); const int_type __eof = traits_type::eof();
__c = __this_sb->sbumpc(); __streambuf_type* __this_sb = this->rdbuf();
bool __testdelim = __c == __idelim; int_type __c = __this_sb->sgetc();
bool __testeof = __c == __eof;
bool __testput = true;
while (!__testeof && !__testdelim while (__c != __eof && __c != __idelim
&& (__testput = __sb.sputc(traits_type::to_char_type(__c)) && (__sb.sputc(traits_type::to_char_type(__c)) != __eof))
!= __eof))
{ {
++_M_gcount; ++_M_gcount;
__c = __this_sb->sbumpc(); __c = __this_sb->snextc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
} }
if (__testdelim || !__testput) if (__c == __eof)
__this_sb->sputbackc(traits_type::to_char_type(__c));
if (__testeof)
this->setstate(ios_base::eofbit); this->setstate(ios_base::eofbit);
} }
catch(exception& __fail) catch(exception& __fail)
{ {
// Exception may result from sputc->overflow. // 27.6.1.3 paragraph 1
__this_sb->sputbackc(traits_type::to_char_type(__c)); // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
} }
} }
if (!_M_gcount) if (!_M_gcount)
...@@ -674,33 +662,28 @@ namespace std ...@@ -674,33 +662,28 @@ namespace std
{ {
try try
{ {
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc();
++_M_gcount;
const int_type __idelim = traits_type::to_int_type(__delim); const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof(); const int_type __eof = traits_type::eof();
bool __testdelim = __c == __idelim; __streambuf_type* __sb = this->rdbuf();
bool __testeof = __c == __eof; int_type __c = __sb->sgetc();
while (_M_gcount < __n && !__testeof && !__testdelim) while (_M_gcount + 1 < __n && __c != __eof && __c != __idelim)
{ {
*__s++ = traits_type::to_char_type(__c); *__s++ = traits_type::to_char_type(__c);
__c = __sb->sbumpc(); __c = __sb->snextc();
++_M_gcount; ++_M_gcount;
__testeof = __c == __eof;
__testdelim = __c == __idelim;
} }
if (__c == __eof)
if (__testeof) this->setstate(ios_base::eofbit);
{ else
--_M_gcount;
this->setstate(ios_base::eofbit);
}
else if (!__testdelim)
{ {
--_M_gcount; if (__c == __idelim)
__sb->sputbackc(traits_type::to_char_type(__c)); {
this->setstate(ios_base::failbit); __sb->snextc();
++_M_gcount;
}
else
this->setstate(ios_base::failbit);
} }
} }
catch(exception& __fail) catch(exception& __fail)
...@@ -1102,22 +1085,16 @@ namespace std ...@@ -1102,22 +1085,16 @@ namespace std
const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc()); const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
const int_type __eof = _Traits::eof(); const int_type __eof = _Traits::eof();
__streambuf_type* __sb = __in.rdbuf(); __streambuf_type* __sb = __in.rdbuf();
int_type __c = __sb->sbumpc(); int_type __c = __sb->sgetc();
bool __testeof = __c == __eof;
bool __testsp = __ctype.is(ctype_base::space, __c);
while (__extracted < __num - 1 && !__testeof && !__testsp) while (__extracted < __num - 1
&& __c != __eof && !__ctype.is(ctype_base::space, __c))
{ {
*__s++ = __c; *__s++ = __c;
++__extracted; ++__extracted;
__c = __sb->sbumpc(); __c = __sb->snextc();
__testeof = __c == __eof;
__testsp = __ctype.is(ctype_base::space, __c);
} }
if (__c == __eof)
if (!__testeof)
__sb->sputbackc(__c);
else
__in.setstate(ios_base::eofbit); __in.setstate(ios_base::eofbit);
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
...@@ -1149,26 +1126,15 @@ namespace std ...@@ -1149,26 +1126,15 @@ namespace std
typedef typename __istream_type::__streambuf_type __streambuf_type; typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type; typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename __istream_type::int_type __int_type; typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::char_type __char_type;
const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc()); const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
__streambuf_type* __sb = __in.rdbuf();
const __int_type __eof = _Traits::eof(); const __int_type __eof = _Traits::eof();
__int_type __c; __streambuf_type* __sb = __in.rdbuf();
bool __testeof; __int_type __c = __sb->sgetc();
bool __testsp;
do
{
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testsp = __ctype.is(ctype_base::space, __c);
}
while (!__testeof && __testsp);
if (!__testeof && !__testsp) while (__c != __eof && __ctype.is(ctype_base::space, __c))
__sb->sputbackc(__c); __c = __sb->snextc();
else if (__c == __eof)
__in.setstate(ios_base::eofbit); __in.setstate(ios_base::eofbit);
return __in; return __in;
...@@ -1199,21 +1165,16 @@ namespace std ...@@ -1199,21 +1165,16 @@ namespace std
const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc()); const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
const __int_type __eof = _Traits::eof(); const __int_type __eof = _Traits::eof();
__streambuf_type* __sb = __in.rdbuf(); __streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sbumpc(); __int_type __c = __sb->sgetc();
bool __testeof = __c == __eof;
bool __testsp = __ctype.is(ctype_base::space, __c); while (__extracted < __n
&& __c != __eof && !__ctype.is(ctype_base::space, __c))
while (__extracted < __n && !__testeof && !__testsp)
{ {
__str += _Traits::to_char_type(__c); __str += _Traits::to_char_type(__c);
++__extracted; ++__extracted;
__c = __sb->sbumpc(); __c = __sb->snextc();
__testeof = __c == __eof;
__testsp = __ctype.is(ctype_base::space, __c);
} }
if (!__testeof) if (__c == __eof)
__sb->sputbackc(__c);
else
__in.setstate(ios_base::eofbit); __in.setstate(ios_base::eofbit);
__in.width(0); __in.width(0);
} }
...@@ -1250,17 +1211,15 @@ namespace std ...@@ -1250,17 +1211,15 @@ namespace std
__int_type __c = __sb->sbumpc(); __int_type __c = __sb->sbumpc();
const __int_type __eof = _Traits::eof(); const __int_type __eof = _Traits::eof();
__testdelim = __c == __idelim; __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
while (__extracted <= __n && !__testeof && !__testdelim) while (__extracted <= __n && __c != __eof && !__testdelim)
{ {
__str += _Traits::to_char_type(__c); __str += _Traits::to_char_type(__c);
++__extracted; ++__extracted;
__c = __sb->sbumpc(); __c = __sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim; __testdelim = __c == __idelim;
} }
if (__testeof) if (__c == __eof)
__in.setstate(ios_base::eofbit); __in.setstate(ios_base::eofbit);
} }
if (!__extracted && !__testdelim) if (!__extracted && !__testdelim)
......
// Concept checking instantiations -*- C++ -*- // Concept checking instantiations -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation // Copyright (C) 2001, 2002 Free Software Foundation
// //
// This file is part of GNU CC. // This file is part of GNU CC.
// //
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#ifdef _GLIBCPP_CONCEPT_CHECKS #ifdef _GLIBCPP_CONCEPT_CHECKS
#include <memory> #include <memory>
#include <vector>
#include <ostream> #include <ostream>
#define _Instantiate(...) template void __function_requires< __VA_ARGS__ > () #define _Instantiate(...) template void __function_requires< __VA_ARGS__ > ()
...@@ -49,36 +48,12 @@ namespace __gnu_cxx ...@@ -49,36 +48,12 @@ namespace __gnu_cxx
{ {
template void __aux_require_boolean_expr<bool>(bool const&); template void __aux_require_boolean_expr<bool>(bool const&);
_Instantiate(_BidirectionalIteratorConcept<
__normal_iterator< std::locale::facet**,
std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
_Instantiate(_BidirectionalIteratorConcept<
__normal_iterator< unsigned*,
std::vector<unsigned, std::allocator<unsigned> > > > );
_Instantiate(_ConvertibleConcept<std::locale::facet*, std::locale::facet*> );
_Instantiate(_ConvertibleConcept<unsigned, unsigned> ); _Instantiate(_ConvertibleConcept<unsigned, unsigned> );
_Instantiate(_InputIteratorConcept<char*> ); _Instantiate(_InputIteratorConcept<char*> );
_Instantiate(_InputIteratorConcept<char const*> ); _Instantiate(_InputIteratorConcept<char const*> );
_Instantiate(_InputIteratorConcept<std::locale::facet**> );
_Instantiate(_InputIteratorConcept<
__normal_iterator< std::locale::facet* const*,
std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
_Instantiate(_InputIteratorConcept<
__normal_iterator< std::locale::facet**,
std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
_Instantiate(_InputIteratorConcept<
__normal_iterator< unsigned*,
std::vector<unsigned, std::allocator<unsigned> > > > );
#ifdef _GLIBCPP_USE_WCHAR_T #ifdef _GLIBCPP_USE_WCHAR_T
_Instantiate(_InputIteratorConcept<wchar_t*> ); _Instantiate(_InputIteratorConcept<wchar_t*> );
...@@ -97,29 +72,6 @@ namespace __gnu_cxx ...@@ -97,29 +72,6 @@ namespace __gnu_cxx
_Instantiate(_LessThanComparableConcept<unsigned> ); _Instantiate(_LessThanComparableConcept<unsigned> );
_Instantiate(_Mutable_BidirectionalIteratorConcept<
__normal_iterator< std::locale::facet**,
std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
_Instantiate(_Mutable_BidirectionalIteratorConcept<
__normal_iterator< unsigned*,
std::vector<unsigned, std::allocator<unsigned> > > > );
_Instantiate(_Mutable_ForwardIteratorConcept<
__normal_iterator< std::locale::facet**,
std::vector<std::locale::facet*,std::allocator<std::locale::facet*> > > > );
_Instantiate(_OutputIteratorConcept<
std::locale::facet**, std::locale::facet*> );
_Instantiate(_OutputIteratorConcept<
__normal_iterator< std::locale::facet**,
std::vector<std::locale::facet*, std::allocator<std::locale::facet* > > >,
std::locale::facet* > );
_Instantiate(_OutputIteratorConcept<__normal_iterator<
unsigned*, std::vector<unsigned, std::allocator<unsigned> > >, unsigned> );
_Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator< _Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator<
char, std::char_traits<char> >, char> ); char, std::char_traits<char> >, char> );
...@@ -153,7 +105,6 @@ namespace __gnu_cxx ...@@ -153,7 +105,6 @@ namespace __gnu_cxx
_Instantiate(_RandomAccessIteratorConcept<wchar_t const*> ); _Instantiate(_RandomAccessIteratorConcept<wchar_t const*> );
#endif #endif
} // namespace __gnu_cxx } // namespace __gnu_cxx
#undef _Instantiate #undef _Instantiate
......
...@@ -33,21 +33,15 @@ ...@@ -33,21 +33,15 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <memory> #include <memory>
#include <vector>
namespace std namespace std
{ {
template class allocator<char>; template class allocator<char>;
template class allocator<wchar_t>; template class allocator<wchar_t>;
#ifdef __USE_MALLOC
template class __malloc_alloc_template<0>; template class __malloc_alloc_template<0>;
#else
#ifndef __USE_MALLOC
template class __default_alloc_template<true, 0>; template class __default_alloc_template<true, 0>;
#endif #endif
template
void
vector<unsigned int>::
_M_insert_aux(vector<unsigned int>::iterator, unsigned int const &);
} // namespace std } // namespace std
// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com> // 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -29,8 +29,6 @@ void test01() ...@@ -29,8 +29,6 @@ void test01()
{ {
bool test = true; bool test = true;
std::string s("lack of sunlight, no water error"); std::string s("lack of sunlight, no water error");
// XXX work around long-standing, pathalogical, hostility-inducing parser bug
// std::logic_error obj(std::string(strlit));
// 1 // 1
std::logic_error obj = std::logic_error(s); std::logic_error obj = std::logic_error(s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment