Commit 0f3d27f0 by Jonathan Wakely Committed by Jonathan Wakely

re PR libstdc++/64276 (would be better to use __cpp_exceptions rather than…

re PR libstdc++/64276 (would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available)

	PR libstdc++/64276
	* doc/doxygen/user.cfg.in: Define __cpp_exceptions and __cpp_rtti.
	* doc/html/manual/using_exceptions.html: Regenerate.
	* doc/xml/manual/using_exceptions.xml: Use SD-6 feature-testing
	macros, __cpp_exceptions and __cpp_rtti, instead of __EXCEPTIONS and
	__GXX_RTTI.
	* include/bits/c++config: Likewise.
	* include/bits/locale_classes.tcc: Likewise.
	* include/bits/shared_ptr.h: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/debug/formatter.h: Likewise.
	* include/experimental/any: Likewise.
	* include/ext/rope: Likewise.
	* include/ext/ropeimpl.h: Likewise.
	* include/std/functional: Likewise.
	* include/tr1/functional: Likewise.
	* include/tr1/shared_ptr.h: Likewise.
	* libsupc++/eh_call.cc: Likewise.
	* libsupc++/eh_personality.cc: Likewise.
	* libsupc++/exception_defines.h: Likewise.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/guard.cc: Likewise.
	* libsupc++/pbase_type_info.cc: Likewise.
	* libsupc++/pointer_type_info.cc: Likewise.
	* libsupc++/vterminate.cc: Likewise.
	* src/c++11/thread.cc: Likewise.

From-SVN: r218679
parent 4db4954f
...@@ -5,6 +5,33 @@ ...@@ -5,6 +5,33 @@
disabled. disabled.
* testsuite/18_support/exception_ptr/64241.cc: New. * testsuite/18_support/exception_ptr/64241.cc: New.
PR libstdc++/64276
* doc/doxygen/user.cfg.in: Define __cpp_exceptions and __cpp_rtti.
* doc/html/manual/using_exceptions.html: Regenerate.
* doc/xml/manual/using_exceptions.xml: Use SD-6 feature-testing
macros, __cpp_exceptions and __cpp_rtti, instead of __EXCEPTIONS and
__GXX_RTTI.
* include/bits/c++config: Likewise.
* include/bits/locale_classes.tcc: Likewise.
* include/bits/shared_ptr.h: Likewise.
* include/bits/shared_ptr_base.h: Likewise.
* include/debug/formatter.h: Likewise.
* include/experimental/any: Likewise.
* include/ext/rope: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/std/functional: Likewise.
* include/tr1/functional: Likewise.
* include/tr1/shared_ptr.h: Likewise.
* libsupc++/eh_call.cc: Likewise.
* libsupc++/eh_personality.cc: Likewise.
* libsupc++/exception_defines.h: Likewise.
* libsupc++/exception_ptr.h: Likewise.
* libsupc++/guard.cc: Likewise.
* libsupc++/pbase_type_info.cc: Likewise.
* libsupc++/pointer_type_info.cc: Likewise.
* libsupc++/vterminate.cc: Likewise.
* src/c++11/thread.cc: Likewise.
2014-12-12 Jonathan Wakely <jwakely@redhat.com> 2014-12-12 Jonathan Wakely <jwakely@redhat.com>
* include/bits/stl_iterator.h (make_reverse_iterator): LWG DR 2285. * include/bits/stl_iterator.h (make_reverse_iterator): LWG DR 2285.
......
...@@ -2142,8 +2142,8 @@ PREDEFINED = __cplusplus=201103L \ ...@@ -2142,8 +2142,8 @@ PREDEFINED = __cplusplus=201103L \
_GLIBCXX_USE_C99_STDINT_TR1 \ _GLIBCXX_USE_C99_STDINT_TR1 \
_GLIBCXX_USE_SCHED_YIELD \ _GLIBCXX_USE_SCHED_YIELD \
_GLIBCXX_USE_NANOSLEEP \ _GLIBCXX_USE_NANOSLEEP \
__EXCEPTIONS \ __cpp_exceptions \
__GXX_RTTI \ __cpp_rtti \
ATOMIC_INT_LOCK_FREE \ ATOMIC_INT_LOCK_FREE \
PB_DS_DATA_TRUE_INDICATOR \ PB_DS_DATA_TRUE_INDICATOR \
PB_DS_STATIC_ASSERT=// \ PB_DS_STATIC_ASSERT=// \
......
...@@ -151,7 +151,7 @@ exception neutrality and exception safety. ...@@ -151,7 +151,7 @@ exception neutrality and exception safety.
and <code class="literal">__throw_exception_again</code>. They are defined and <code class="literal">__throw_exception_again</code>. They are defined
as follows. as follows.
</p><pre class="programlisting"> </p><pre class="programlisting">
#ifdef __EXCEPTIONS #if __cpp_exceptions
# define __try try # define __try try
# define __catch(X) catch(X) # define __catch(X) catch(X)
# define __throw_exception_again throw # define __throw_exception_again throw
...@@ -165,7 +165,7 @@ exception neutrality and exception safety. ...@@ -165,7 +165,7 @@ exception neutrality and exception safety.
class <code class="classname">exception</code>, there exists a corresponding class <code class="classname">exception</code>, there exists a corresponding
function with C language linkage. An example: function with C language linkage. An example:
</p><pre class="programlisting"> </p><pre class="programlisting">
#ifdef __EXCEPTIONS #if __cpp_exceptions
void __throw_bad_exception(void) void __throw_bad_exception(void)
{ throw bad_exception(); } { throw bad_exception(); }
#else #else
...@@ -310,4 +310,4 @@ is called. ...@@ -310,4 +310,4 @@ is called.
<a class="link" href="http://gcc.gnu.org/PR25191" target="_top"> <a class="link" href="http://gcc.gnu.org/PR25191" target="_top">
GCC Bug 25191: exception_defines.h #defines try/catch GCC Bug 25191: exception_defines.h #defines try/catch
</a> </a>
</em>. </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Debugging Support</td></tr></table></div></body></html> </em>. </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Debugging Support</td></tr></table></div></body></html>
\ No newline at end of file
...@@ -251,7 +251,7 @@ exception neutrality and exception safety. ...@@ -251,7 +251,7 @@ exception neutrality and exception safety.
</para> </para>
<programlisting> <programlisting>
#ifdef __EXCEPTIONS #if __cpp_exceptions
# define __try try # define __try try
# define __catch(X) catch(X) # define __catch(X) catch(X)
# define __throw_exception_again throw # define __throw_exception_again throw
...@@ -269,7 +269,7 @@ exception neutrality and exception safety. ...@@ -269,7 +269,7 @@ exception neutrality and exception safety.
</para> </para>
<programlisting> <programlisting>
#ifdef __EXCEPTIONS #if __cpp_exceptions
void __throw_bad_exception(void) void __throw_bad_exception(void)
{ throw bad_exception(); } { throw bad_exception(); }
#else #else
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
#endif #endif
#ifndef _GLIBCXX_THROW_OR_ABORT #ifndef _GLIBCXX_THROW_OR_ABORT
# if __EXCEPTIONS # if __cpp_exceptions
# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) # define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC))
# else # else
# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) # define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
......
...@@ -106,7 +106,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -106,7 +106,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const size_t __i = _Facet::id._M_id(); const size_t __i = _Facet::id._M_id();
const locale::facet** __facets = __loc._M_impl->_M_facets; const locale::facet** __facets = __loc._M_impl->_M_facets;
return (__i < __loc._M_impl->_M_facets_size return (__i < __loc._M_impl->_M_facets_size
#ifdef __GXX_RTTI #if __cpp_rtti
&& dynamic_cast<const _Facet*>(__facets[__i])); && dynamic_cast<const _Facet*>(__facets[__i]));
#else #else
&& static_cast<const _Facet*>(__facets[__i])); && static_cast<const _Facet*>(__facets[__i]));
...@@ -135,7 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -135,7 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const locale::facet** __facets = __loc._M_impl->_M_facets; const locale::facet** __facets = __loc._M_impl->_M_facets;
if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i]) if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
__throw_bad_cast(); __throw_bad_cast();
#ifdef __GXX_RTTI #if __cpp_rtti
return dynamic_cast<const _Facet&>(*__facets[__i]); return dynamic_cast<const _Facet&>(*__facets[__i]);
#else #else
return static_cast<const _Facet&>(*__facets[__i]); return static_cast<const _Facet&>(*__facets[__i]);
......
...@@ -75,7 +75,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -75,7 +75,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Del* inline _Del*
get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
#else #else
return 0; return 0;
......
...@@ -476,7 +476,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -476,7 +476,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
virtual void* virtual void*
_M_get_deleter(const std::type_info& __ti) noexcept _M_get_deleter(const std::type_info& __ti) noexcept
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2400. shared_ptr's get_deleter() should use addressof() // 2400. shared_ptr's get_deleter() should use addressof()
return __ti == typeid(_Deleter) return __ti == typeid(_Deleter)
...@@ -544,7 +544,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -544,7 +544,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
virtual void* virtual void*
_M_get_deleter(const std::type_info& __ti) noexcept _M_get_deleter(const std::type_info& __ti) noexcept
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
if (__ti == typeid(_Sp_make_shared_tag)) if (__ti == typeid(_Sp_make_shared_tag))
return const_cast<typename remove_cv<_Tp>::type*>(_M_ptr()); return const_cast<typename remove_cv<_Tp>::type*>(_M_ptr());
#endif #endif
...@@ -1087,7 +1087,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1087,7 +1087,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
{ return _M_refcount._M_less(__rhs._M_refcount); } { return _M_refcount._M_less(__rhs._M_refcount); }
#ifdef __GXX_RTTI #if __cpp_rtti
protected: protected:
// This constructor is non-standard, it is used by allocate_shared. // This constructor is non-standard, it is used by allocate_shared.
template<typename _Alloc, typename... _Args> template<typename _Alloc, typename... _Args>
......
...@@ -218,7 +218,7 @@ namespace __gnu_debug ...@@ -218,7 +218,7 @@ namespace __gnu_debug
{ {
_M_variant._M_iterator._M_name = __name; _M_variant._M_iterator._M_name = __name;
_M_variant._M_iterator._M_address = &__it; _M_variant._M_iterator._M_address = &__it;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_type = &typeid(__it); _M_variant._M_iterator._M_type = &typeid(__it);
#else #else
_M_variant._M_iterator._M_type = 0; _M_variant._M_iterator._M_type = 0;
...@@ -228,7 +228,7 @@ namespace __gnu_debug ...@@ -228,7 +228,7 @@ namespace __gnu_debug
typename _Sequence::iterator>:: typename _Sequence::iterator>::
__value ? __mutable_iterator : __const_iterator; __value ? __mutable_iterator : __const_iterator;
_M_variant._M_iterator._M_sequence = __it._M_get_sequence(); _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_seq_type = &typeid(_Sequence); _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
#else #else
_M_variant._M_iterator._M_seq_type = 0; _M_variant._M_iterator._M_seq_type = 0;
...@@ -256,7 +256,7 @@ namespace __gnu_debug ...@@ -256,7 +256,7 @@ namespace __gnu_debug
{ {
_M_variant._M_iterator._M_name = __name; _M_variant._M_iterator._M_name = __name;
_M_variant._M_iterator._M_address = &__it; _M_variant._M_iterator._M_address = &__it;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_type = &typeid(__it); _M_variant._M_iterator._M_type = &typeid(__it);
#else #else
_M_variant._M_iterator._M_type = 0; _M_variant._M_iterator._M_type = 0;
...@@ -266,7 +266,7 @@ namespace __gnu_debug ...@@ -266,7 +266,7 @@ namespace __gnu_debug
typename _Sequence::local_iterator>:: typename _Sequence::local_iterator>::
__value ? __mutable_iterator : __const_iterator; __value ? __mutable_iterator : __const_iterator;
_M_variant._M_iterator._M_sequence = __it._M_get_sequence(); _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_seq_type = &typeid(_Sequence); _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
#else #else
_M_variant._M_iterator._M_seq_type = 0; _M_variant._M_iterator._M_seq_type = 0;
...@@ -291,7 +291,7 @@ namespace __gnu_debug ...@@ -291,7 +291,7 @@ namespace __gnu_debug
{ {
_M_variant._M_iterator._M_name = __name; _M_variant._M_iterator._M_name = __name;
_M_variant._M_iterator._M_address = &__it; _M_variant._M_iterator._M_address = &__it;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_type = &typeid(__it); _M_variant._M_iterator._M_type = &typeid(__it);
#else #else
_M_variant._M_iterator._M_type = 0; _M_variant._M_iterator._M_type = 0;
...@@ -308,7 +308,7 @@ namespace __gnu_debug ...@@ -308,7 +308,7 @@ namespace __gnu_debug
{ {
_M_variant._M_iterator._M_name = __name; _M_variant._M_iterator._M_name = __name;
_M_variant._M_iterator._M_address = &__it; _M_variant._M_iterator._M_address = &__it;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_type = &typeid(__it); _M_variant._M_iterator._M_type = &typeid(__it);
#else #else
_M_variant._M_iterator._M_type = 0; _M_variant._M_iterator._M_type = 0;
...@@ -325,7 +325,7 @@ namespace __gnu_debug ...@@ -325,7 +325,7 @@ namespace __gnu_debug
{ {
_M_variant._M_iterator._M_name = __name; _M_variant._M_iterator._M_name = __name;
_M_variant._M_iterator._M_address = &__it; _M_variant._M_iterator._M_address = &__it;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_iterator._M_type = &typeid(__it); _M_variant._M_iterator._M_type = &typeid(__it);
#else #else
_M_variant._M_iterator._M_type = 0; _M_variant._M_iterator._M_type = 0;
...@@ -345,7 +345,7 @@ namespace __gnu_debug ...@@ -345,7 +345,7 @@ namespace __gnu_debug
_M_variant._M_sequence._M_name = __name; _M_variant._M_sequence._M_name = __name;
_M_variant._M_sequence._M_address = _M_variant._M_sequence._M_address =
static_cast<const _Sequence*>(&__seq); static_cast<const _Sequence*>(&__seq);
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_sequence._M_type = &typeid(_Sequence); _M_variant._M_sequence._M_type = &typeid(_Sequence);
#else #else
_M_variant._M_sequence._M_type = 0; _M_variant._M_sequence._M_type = 0;
...@@ -358,7 +358,7 @@ namespace __gnu_debug ...@@ -358,7 +358,7 @@ namespace __gnu_debug
{ {
_M_variant._M_sequence._M_name = __name; _M_variant._M_sequence._M_name = __name;
_M_variant._M_sequence._M_address = &__seq; _M_variant._M_sequence._M_address = &__seq;
#ifdef __GXX_RTTI #if __cpp_rtti
_M_variant._M_sequence._M_type = &typeid(_Sequence); _M_variant._M_sequence._M_type = &typeid(_Sequence);
#else #else
_M_variant._M_sequence._M_type = 0; _M_variant._M_sequence._M_type = 0;
......
...@@ -74,7 +74,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -74,7 +74,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
[[gnu::noreturn]] inline void __throw_bad_any_cast() [[gnu::noreturn]] inline void __throw_bad_any_cast()
{ {
#ifdef __EXCEPTIONS #if __cpp_exceptions
throw bad_any_cast{}; throw bad_any_cast{};
#else #else
__builtin_abort(); __builtin_abort();
...@@ -111,7 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -111,7 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Manager_internal<_Tp>, _Manager_internal<_Tp>,
_Manager_external<_Tp>>; _Manager_external<_Tp>>;
#ifdef __GXX_RTTI #if __cpp_rtti
// When RTTI is disabled __any_caster assumes the manager is either // When RTTI is disabled __any_caster assumes the manager is either
// _Manager_internal or _Manager_external, so this type must not be used. // _Manager_internal or _Manager_external, so this type must not be used.
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
...@@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template <typename _Allocator> template <typename _Allocator>
any(allocator_arg_t, const _Allocator&) noexcept : any() { } any(allocator_arg_t, const _Allocator&) noexcept : any() { }
#ifdef __GXX_RTTI #if __cpp_rtti
/// Construct with a copy of @p __value as the contained object. /// Construct with a copy of @p __value as the contained object.
template <typename _Allocator, typename _ValueType, template <typename _Allocator, typename _ValueType,
typename _Tp = _Decay<_ValueType>, typename _Tp = _Decay<_ValueType>,
...@@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Reports whether there is a contained object or not. /// Reports whether there is a contained object or not.
bool empty() const noexcept { return _M_manager == nullptr; } bool empty() const noexcept { return _M_manager == nullptr; }
#ifdef __GXX_RTTI #if __cpp_rtti
/// The @c typeid of the contained object, or @c typeid(void) if empty. /// The @c typeid of the contained object, or @c typeid(void) if empty.
const type_info& type() const noexcept const type_info& type() const noexcept
{ {
...@@ -281,7 +281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -281,7 +281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp> template<typename _Tp>
friend void* __any_caster(const any* __any) friend void* __any_caster(const any* __any)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
if (__any->type() != typeid(_Tp)) if (__any->type() != typeid(_Tp))
return nullptr; return nullptr;
#else #else
...@@ -335,7 +335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -335,7 +335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
}; };
#ifdef __GXX_RTTI #if __cpp_rtti
// Manage external contained object using an allocator // Manage external contained object using an allocator
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
struct _Manager_alloc struct _Manager_alloc
...@@ -446,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -446,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
// @} // @}
#ifdef __GXX_RTTI #if __cpp_rtti
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
struct any::_Manager_alloc<_Tp, _Alloc>::_Data struct any::_Manager_alloc<_Tp, _Alloc>::_Data
{ {
...@@ -524,7 +524,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -524,7 +524,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__arg->_M_obj = const_cast<_Tp*>(__ptr); __arg->_M_obj = const_cast<_Tp*>(__ptr);
break; break;
case _Op_get_type_info: case _Op_get_type_info:
#ifdef __GXX_RTTI #if __cpp_rtti
__arg->_M_typeinfo = &typeid(_Tp); __arg->_M_typeinfo = &typeid(_Tp);
#endif #endif
break; break;
...@@ -550,7 +550,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -550,7 +550,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__arg->_M_obj = const_cast<_Tp*>(__ptr); __arg->_M_obj = const_cast<_Tp*>(__ptr);
break; break;
case _Op_get_type_info: case _Op_get_type_info:
#ifdef __GXX_RTTI #if __cpp_rtti
__arg->_M_typeinfo = &typeid(_Tp); __arg->_M_typeinfo = &typeid(_Tp);
#endif #endif
break; break;
...@@ -563,7 +563,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -563,7 +563,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
} }
#ifdef __GXX_RTTI #if __cpp_rtti
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
any::_Manager_alloc<_Tp, _Alloc>:: any::_Manager_alloc<_Tp, _Alloc>::
......
...@@ -923,7 +923,7 @@ protected: ...@@ -923,7 +923,7 @@ protected:
~_Rope_self_destruct_ptr() ~_Rope_self_destruct_ptr()
{ _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); } { _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); }
#ifdef __EXCEPTIONS #if __cpp_exceptions
_Rope_self_destruct_ptr() : _M_ptr(0) { }; _Rope_self_destruct_ptr() : _M_ptr(0) { };
#else #else
_Rope_self_destruct_ptr() { }; _Rope_self_destruct_ptr() { };
......
...@@ -1223,7 +1223,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1223,7 +1223,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif #endif
__result = _S_concat(__forest[__i], __result); __result = _S_concat(__forest[__i], __result);
__forest[__i]->_M_unref_nonnil(); __forest[__i]->_M_unref_nonnil();
#if !defined(__GC) && defined(__EXCEPTIONS) #if !defined(__GC) && __cpp_exceptions
__forest[__i] = 0; __forest[__i] = 0;
#endif #endif
} }
......
...@@ -1733,7 +1733,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type) ...@@ -1733,7 +1733,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -1799,7 +1799,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type) ...@@ -1799,7 +1799,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -1936,7 +1936,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type) ...@@ -1936,7 +1936,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -2198,7 +2198,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type) ...@@ -2198,7 +2198,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
*/ */
_Res operator()(_ArgTypes... __args) const; _Res operator()(_ArgTypes... __args) const;
#ifdef __GXX_RTTI #if __cpp_rtti
// [3.7.2.5] function target access // [3.7.2.5] function target access
/** /**
* @brief Determine the type of the target of this function object * @brief Determine the type of the target of this function object
...@@ -2271,7 +2271,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type) ...@@ -2271,7 +2271,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...); return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
} }
#ifdef __GXX_RTTI #if __cpp_rtti
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
const type_info& const type_info&
function<_Res(_ArgTypes...)>:: function<_Res(_ArgTypes...)>::
......
...@@ -1659,7 +1659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1659,7 +1659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -1725,7 +1725,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1725,7 +1725,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -1859,7 +1859,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1859,7 +1859,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
...@@ -2066,7 +2066,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -2066,7 +2066,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/ */
_Res operator()(_ArgTypes... __args) const; _Res operator()(_ArgTypes... __args) const;
#ifdef __GXX_RTTI #if __cpp_rtti
// [3.7.2.5] function target access // [3.7.2.5] function target access
/** /**
* @brief Determine the type of the target of this function object * @brief Determine the type of the target of this function object
...@@ -2146,7 +2146,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -2146,7 +2146,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return _M_invoker(_M_functor, __args...); return _M_invoker(_M_functor, __args...);
} }
#ifdef __GXX_RTTI #if __cpp_rtti
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
const type_info& const type_info&
function<_Res(_ArgTypes...)>:: function<_Res(_ArgTypes...)>::
......
...@@ -259,7 +259,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -259,7 +259,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
virtual void* virtual void*
_M_get_deleter(const std::type_info& __ti) _M_get_deleter(const std::type_info& __ti)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
return __ti == typeid(_Deleter) ? &_M_del : 0; return __ti == typeid(_Deleter) ? &_M_del : 0;
#else #else
return 0; return 0;
...@@ -788,7 +788,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -788,7 +788,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Del* inline _Del*
get_deleter(const __shared_ptr<_Tp, _Lp>& __p) get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
#else #else
return 0; return 0;
......
...@@ -149,7 +149,7 @@ __cxa_call_unexpected(void* exc_obj_in) ...@@ -149,7 +149,7 @@ __cxa_call_unexpected(void* exc_obj_in)
} }
// If the exception spec allows std::bad_exception, throw that. // If the exception spec allows std::bad_exception, throw that.
#ifdef __EXCEPTIONS #if __cpp_exceptions
if (bad_exception_allowed) if (bad_exception_allowed)
throw std::bad_exception(); throw std::bad_exception();
#endif #endif
......
...@@ -551,7 +551,7 @@ PERSONALITY_FUNCTION (int version, ...@@ -551,7 +551,7 @@ PERSONALITY_FUNCTION (int version,
else if (!foreign_exception) else if (!foreign_exception)
thrown_ptr = __get_object_from_ue (ue_header); thrown_ptr = __get_object_from_ue (ue_header);
#else #else
#ifdef __GXX_RTTI #if __cpp_rtti
// During forced unwinding, match a magic exception type. // During forced unwinding, match a magic exception type.
if (actions & _UA_FORCE_UNWIND) if (actions & _UA_FORCE_UNWIND)
{ {
...@@ -777,7 +777,7 @@ __cxa_call_unexpected (void *exc_obj_in) ...@@ -777,7 +777,7 @@ __cxa_call_unexpected (void *exc_obj_in)
// If the exception spec allows std::bad_exception, throw that. // If the exception spec allows std::bad_exception, throw that.
// We don't have a thrown object to compare against, but since // We don't have a thrown object to compare against, but since
// bad_exception doesn't have virtual bases, that's OK; just pass 0. // bad_exception doesn't have virtual bases, that's OK; just pass 0.
#if defined(__EXCEPTIONS) && defined(__GXX_RTTI) #if __cpp_exceptions && __cpp_rtti
const std::type_info &bad_exc = typeid (std::bad_exception); const std::type_info &bad_exc = typeid (std::bad_exception);
if (check_exception_spec (&info, &bad_exc, 0, xh_switch_value)) if (check_exception_spec (&info, &bad_exc, 0, xh_switch_value))
throw std::bad_exception(); throw std::bad_exception();
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef _EXCEPTION_DEFINES_H #ifndef _EXCEPTION_DEFINES_H
#define _EXCEPTION_DEFINES_H 1 #define _EXCEPTION_DEFINES_H 1
#ifndef __EXCEPTIONS #if ! __cpp_exceptions
// Iff -fno-exceptions, transform error handling code to work without it. // Iff -fno-exceptions, transform error handling code to work without it.
# define __try if (true) # define __try if (true)
# define __catch(X) if (false) # define __catch(X) if (false)
......
...@@ -168,7 +168,7 @@ namespace std ...@@ -168,7 +168,7 @@ namespace std
exception_ptr exception_ptr
make_exception_ptr(_Ex __ex) _GLIBCXX_USE_NOEXCEPT make_exception_ptr(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
{ {
#ifdef __EXCEPTIONS #if __cpp_exceptions
try try
{ {
throw __ex; throw __ex;
......
...@@ -203,7 +203,7 @@ namespace __cxxabiv1 ...@@ -203,7 +203,7 @@ namespace __cxxabiv1
static inline void static inline void
throw_recursive_init_exception() throw_recursive_init_exception()
{ {
#ifdef __EXCEPTIONS #if __cpp_exceptions
throw __gnu_cxx::recursive_init_error(); throw __gnu_cxx::recursive_init_error();
#else #else
// Use __builtin_trap so we don't require abort(). // Use __builtin_trap so we don't require abort().
......
...@@ -37,7 +37,7 @@ __do_catch (const type_info *thr_type, ...@@ -37,7 +37,7 @@ __do_catch (const type_info *thr_type,
if (*this == *thr_type) if (*this == *thr_type)
return true; // same type return true; // same type
#ifdef __GXX_RTTI #if __cpp_rtti
if (typeid (*this) != typeid (*thr_type)) if (typeid (*this) != typeid (*thr_type))
return false; // not both same kind of pointers return false; // not both same kind of pointers
#endif #endif
......
...@@ -40,7 +40,7 @@ __pointer_catch (const __pbase_type_info *thrown_type, ...@@ -40,7 +40,7 @@ __pointer_catch (const __pbase_type_info *thrown_type,
void **thr_obj, void **thr_obj,
unsigned outer) const unsigned outer) const
{ {
#ifdef __GXX_RTTI #if __cpp_rtti
if (outer < 2 && *__pointee == typeid (void)) if (outer < 2 && *__pointee == typeid (void))
{ {
// conversion to void // conversion to void
......
...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// If the exception is derived from std::exception, we can // If the exception is derived from std::exception, we can
// give more information. // give more information.
__try { __throw_exception_again; } __try { __throw_exception_again; }
#ifdef __EXCEPTIONS #if __cpp_exceptions
__catch(const exception& exc) __catch(const exception& exc)
{ {
char const *w = exc.what(); char const *w = exc.what();
......
...@@ -130,7 +130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -130,7 +130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
thread::_M_start_thread(__shared_base_type __b) thread::_M_start_thread(__shared_base_type __b)
{ {
if (!__gthread_active_p()) if (!__gthread_active_p())
#if __EXCEPTIONS #if __cpp_exceptions
throw system_error(make_error_code(errc::operation_not_permitted), throw system_error(make_error_code(errc::operation_not_permitted),
"Enable multithreading to use std::thread"); "Enable multithreading to use std::thread");
#else #else
......
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