aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2003-04-28 23:05:57 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2003-04-28 23:05:57 +0000
commit988ad90d003221abfb91157ef289f702b055a8fd (patch)
tree7f56a8cb32f19328c45d4c82a33c36a558fbdd8a /libstdc++-v3
parent6ef4b79c95c5494878bbea87a9cda9e45a75e163 (diff)
downloadgcc-988ad90d003221abfb91157ef289f702b055a8fd.zip
gcc-988ad90d003221abfb91157ef289f702b055a8fd.tar.gz
gcc-988ad90d003221abfb91157ef289f702b055a8fd.tar.bz2
localename.cc: Standardize exception strings.
2003-04-28 Benjamin Kosnik <bkoz@redhat.com> * src/localename.cc: Standardize exception strings. * src/locale.cc: Same. * src/ios.cc: Same. * include/bits/basic_string.tcc: Same. * include/bits/basic_ios.tcc: Same. * include/std/std_bitset.h: Same. * include/ext/ropeimpl.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_bvector.h: Same. * config/locale/generic/c_locale.cc: Same. * config/locale/gnu/c_locale.cc: Same. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same. * testsuite/testsuite_hooks.cc (__gnu_cxx_test): Modify. From-SVN: r66192
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog18
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.cc5
-rw-r--r--libstdc++-v3/config/locale/gnu/c_locale.cc3
-rw-r--r--libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h6
-rw-r--r--libstdc++-v3/include/bits/basic_ios.tcc2
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc2
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h2
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h2
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h2
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h2
-rw-r--r--libstdc++-v3/include/std/std_bitset.h24
-rw-r--r--libstdc++-v3/src/ios.cc5
-rw-r--r--libstdc++-v3/src/locale.cc5
-rw-r--r--libstdc++-v3/src/localename.cc2
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.cc7
15 files changed, 55 insertions, 32 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f8fd27b..bf1f4bb 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,21 @@
+2003-04-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/localename.cc: Standardize exception strings.
+ * src/locale.cc: Same.
+ * src/ios.cc: Same.
+ * include/bits/basic_string.tcc: Same.
+ * include/bits/basic_ios.tcc: Same.
+ * include/std/std_bitset.h: Same.
+ * include/ext/ropeimpl.h: Same.
+ * include/bits/stl_vector.h: Same.
+ * include/bits/stl_deque.h: Same.
+ * include/bits/stl_bvector.h: Same.
+ * config/locale/generic/c_locale.cc: Same.
+ * config/locale/gnu/c_locale.cc: Same.
+ * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same.
+
+ * testsuite/testsuite_hooks.cc (__gnu_cxx_test): Modify.
+
2003-04-28 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_streambuf.h (_M_buf_size): is currently
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 8a46ab8..d8873ec 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -215,9 +215,12 @@ namespace std
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
__c_locale)
{
+ // Currently, the generic model only supports the "C" locale.
+ // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html
__cloc = NULL;
if (strcmp(__s, "C"))
- __throw_runtime_error("attempt to create locale from unhandled name in generic implementation; see http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html");
+ __throw_runtime_error("locale::facet::_S_create_c_locale "
+ "name not valid");
}
void
diff --git a/libstdc++-v3/config/locale/gnu/c_locale.cc b/libstdc++-v3/config/locale/gnu/c_locale.cc
index 7dbf811..4dd50d4 100644
--- a/libstdc++-v3/config/locale/gnu/c_locale.cc
+++ b/libstdc++-v3/config/locale/gnu/c_locale.cc
@@ -172,7 +172,8 @@ namespace std
if (!__cloc)
{
// This named locale is not supported by the underlying OS.
- __throw_runtime_error("attempt to create locale from unknown name");
+ __throw_runtime_error("locale::facet::_S_create_c_locale "
+ "name not valid");
}
}
diff --git a/libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h b/libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h
index 9d204ed..38b57b5 100644
--- a/libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h
+++ b/libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h
@@ -130,13 +130,15 @@
{
_M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
if (_M_in_desc == __err)
- __throw_runtime_error("creating iconv input descriptor failed.");
+ __throw_runtime_error("__enc_traits::_M_init "
+ "creating iconv input descriptor failed");
}
if (!_M_out_desc)
{
_M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
if (_M_out_desc == __err)
- __throw_runtime_error("creating iconv output descriptor failed.");
+ __throw_runtime_error("__enc_traits::_M_init "
+ "creating iconv output descriptor failed");
}
}
diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc
index 8ac1c60..0c1e735 100644
--- a/libstdc++-v3/include/bits/basic_ios.tcc
+++ b/libstdc++-v3/include/bits/basic_ios.tcc
@@ -43,7 +43,7 @@ namespace std
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
- __throw_ios_failure("basic_ios::clear(iostate) caused exception");
+ __throw_ios_failure("basic_ios::clear");
}
template<typename _CharT, typename _Traits>
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 657b997..d649ed0 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -142,7 +142,7 @@ namespace std
// NB: Not required, but considered best practice.
if (__builtin_expect(__beg == _InIter(), 0))
- __throw_logic_error("attempt to create string with null pointer");
+ __throw_logic_error("basic_string::_S_construct NULL not valid");
size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 29fd692..586a1cf 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -480,7 +480,7 @@ template <typename _Alloc>
void _M_range_check(size_type __n) const {
if (__n >= this->size())
- __throw_out_of_range(__N("vector<bool>"));
+ __throw_out_of_range(__N("vector<bool>::_M_range_check"));
}
reference at(size_type __n)
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 63257e2..5cef4de 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -940,7 +940,7 @@ namespace std
_M_range_check(size_type __n) const
{
if (__n >= this->size())
- __throw_out_of_range(__N("std::deque [] access out of range"));
+ __throw_out_of_range(__N("deque::_M_range_check"));
}
public:
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index bf28813..c90a476 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -524,7 +524,7 @@ namespace std
_M_range_check(size_type __n) const
{
if (__n >= this->size())
- __throw_out_of_range(__N("std::vector [] access out of range"));
+ __throw_out_of_range(__N("vector::_M_range_check"));
}
public:
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 91bd5e0..a1fba60 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -1121,7 +1121,7 @@ rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
}
if (__result->_M_depth > _RopeRep::_S_max_rope_depth)
- __throw_length_error("rope too long");
+ __throw_length_error("rope::_S_balance");
return(__result);
}
diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h
index 4292a44..e2e2cc5 100644
--- a/libstdc++-v3/include/std/std_bitset.h
+++ b/libstdc++-v3/include/std/std_bitset.h
@@ -264,7 +264,7 @@ namespace std
{
for (size_t __i = 1; __i < _Nw; ++__i)
if (_M_w[__i])
- __throw_overflow_error(__N("bitset value is too large to fit in unsigned long"));
+ __throw_overflow_error(__N("_Base_bitset::_M_do_to_ulong"));
return _M_w[0];
}
@@ -466,7 +466,10 @@ namespace std
// localized to this single should-never-get-this-far function.
_WordT&
_M_getword(size_t) const
- { __throw_out_of_range(__N("bitset is zero-length")); return *new _WordT; }
+ {
+ __throw_out_of_range(__N("_Base_bitset::_M_getword"));
+ return *new _WordT;
+ }
_WordT
_M_hiword() const { return 0; }
@@ -706,8 +709,7 @@ namespace std
size_t __pos = 0) : _Base()
{
if (__pos > __s.size())
- __throw_out_of_range("bitset -- initial position is larger than "
- "the string itself");
+ __throw_out_of_range("bitset::bitset initial position not valid");
_M_copy_from_string(__s, __pos,
basic_string<_CharT, _Traits, _Alloc>::npos);
}
@@ -726,8 +728,7 @@ namespace std
size_t __pos, size_t __n) : _Base()
{
if (__pos > __s.size())
- __throw_out_of_range("bitset -- initial position is larger than "
- "the string itself");
+ __throw_out_of_range("bitset::bitset initial position not valid");
_M_copy_from_string(__s, __pos, __n);
}
@@ -862,7 +863,7 @@ namespace std
set(size_t __pos, bool __val = true)
{
if (__pos >= _Nb)
- __throw_out_of_range(__N("bitset::set() argument too large"));
+ __throw_out_of_range(__N("bitset::set"));
return _Unchecked_set(__pos, __val);
}
@@ -887,7 +888,7 @@ namespace std
reset(size_t __pos)
{
if (__pos >= _Nb)
- __throw_out_of_range(__N("bitset::reset() argument too large"));
+ __throw_out_of_range(__N("bitset::reset"));
return _Unchecked_reset(__pos);
}
@@ -911,7 +912,7 @@ namespace std
flip(size_t __pos)
{
if (__pos >= _Nb)
- __throw_out_of_range(__N("bitset::flip() argument too large"));
+ __throw_out_of_range(__N("bitset::flip"));
return _Unchecked_flip(__pos);
}
@@ -1014,7 +1015,7 @@ namespace std
test(size_t __pos) const
{
if (__pos >= _Nb)
- __throw_out_of_range(__N("bitset::test() argument too large"));
+ __throw_out_of_range(__N("bitset::test"));
return _Unchecked_test(__pos);
}
@@ -1083,8 +1084,7 @@ namespace std
set(__i);
break;
default:
- __throw_invalid_argument("bitset -- string contains characters "
- "which are neither 0 nor 1");
+ __throw_invalid_argument("bitset::_M_copy_from_string");
}
}
}
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index 7ce3339..0adc4a9 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -279,7 +279,8 @@ namespace std
{
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
- __throw_ios_failure("ios_base::_M_grow_words failure");
+ __throw_ios_failure("ios_base::_M_grow_words "
+ "allocation failed");
return _M_word_zero;
}
for (int i = 0; i < _M_word_size; i++)
@@ -294,7 +295,7 @@ namespace std
{
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
- __throw_ios_failure("ios_base::_M_grow_words failure");
+ __throw_ios_failure("ios_base::_M_grow_words ix not valid");
return _M_word_zero;
}
}
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc
index 604bd86..89ed915 100644
--- a/libstdc++-v3/src/locale.cc
+++ b/libstdc++-v3/src/locale.cc
@@ -279,7 +279,7 @@ namespace std
}
}
else
- __throw_runtime_error("attempt to create locale from NULL name");
+ __throw_runtime_error("locale::locale NULL not valid");
}
locale::locale(const locale& __base, const char* __s, category __cat)
@@ -434,7 +434,8 @@ namespace std
__ret = all;
break;
default:
- __throw_runtime_error("bad locale category");
+ __throw_runtime_error("locale::_S_normalize_category "
+ "category not found");
}
}
return __ret;
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index e8c7c5f..c09900b 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -321,7 +321,7 @@ namespace std
{
size_t __index = __idp->_M_id();
if ((__index > (__imp->_M_facets_size - 1)) || !__imp->_M_facets[__index])
- __throw_runtime_error("no locale facet");
+ __throw_runtime_error("locale::_Impl::_M_replace_facet");
_M_install_facet(__idp, __imp->_M_facets[__index]);
}
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.cc b/libstdc++-v3/testsuite/testsuite_hooks.cc
index 988ef03..9b8d48e 100644
--- a/libstdc++-v3/testsuite/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/testsuite_hooks.cc
@@ -198,11 +198,8 @@ namespace __gnu_cxx_test
}
catch (std::runtime_error& ex)
{
- // Thrown by generic implemenation.
- if (std::strstr(ex.what(), "unhandled name in generic implementation"))
- exit(0);
- // Thrown by gnu implemenation.
- else if (std::strstr(ex.what(), "unknown name"))
+ // Thrown by generic and gnu implemenation if named locale fails.
+ if (std::strstr(ex.what(), "name not valid"))
exit(0);
else
throw;