diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3fc2fd27abae719760e07dcb0e3e11b36b12dc96..e8a0c709ddd7127afc75a8b136643592587aca84 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2007-12-17 Jonathan Wakely <jwakely.gcc@gmail.com> + + * include/bits/locale_classes.h: Simplify RTTI checks. + 2007-12-17 Jonathan Wakely <jwakely.gcc@gmail.com> * docs/html/test.html: Fix paths and notes on running subset of tests. diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h index 4eee8621b53f3a8b388ccee26bb69cf5963d20a1..0264236a9a09e475774a44097f9da40a5aae7ef9 100644 --- a/libstdc++-v3/include/bits/locale_classes.h +++ b/libstdc++-v3/include/bits/locale_classes.h @@ -579,17 +579,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { const size_t __i = _Facet::id._M_id(); const locale::facet** __facets = __loc._M_impl->_M_facets; - bool __b(false); - try - { - if (__i < __loc._M_impl->_M_facets_size - && dynamic_cast<const _Facet*>(__facets[__i]) != NULL) - __b = true; - - } - catch (...) - { } - return __b; + return __i < __loc._M_impl->_M_facets_size + && dynamic_cast<const _Facet*>(__facets[__i]) != NULL; } /** @@ -611,8 +602,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { const size_t __i = _Facet::id._M_id(); const locale::facet** __facets = __loc._M_impl->_M_facets; - if (__i >= __loc._M_impl->_M_facets_size - || dynamic_cast<const _Facet*>(__facets[__i]) == NULL) + if (__i >= __loc._M_impl->_M_facets_size || __facets[__i] == NULL) __throw_bad_cast(); return dynamic_cast<const _Facet&>(*__facets[__i]); }