Commit c947d638 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/38596 (tr1_impl/functional incompatible with -fno-rtti)

2008-12-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/38596
	* include/tr1_impl/function (function<>::target,
	function<>::target_type): Provide only when __GXX_RTTI is defined.
	(_Function_base::_M_manager, _Ref_manager<>::_M_manager,
	_Function_handler<void(_ArgTypes...), _Member _Class::*>::_M_manager):
	Adjust.

From-SVN: r142862
parent 924eabec
2008-12-21 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/38596
* include/tr1_impl/function (function<>::target,
function<>::target_type): Provide only when __GXX_RTTI is defined.
(_Function_base::_M_manager, _Ref_manager<>::_M_manager,
_Function_handler<void(_ArgTypes...), _Member _Class::*>::_M_manager):
Adjust.
2008-12-19 Ben Elliston <bje@au.ibm.com> 2008-12-19 Ben Elliston <bje@au.ibm.com>
* acinclude.m4: Guard a variable test against an empty string. * acinclude.m4: Guard a variable test against an empty string.
......
...@@ -1531,10 +1531,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -1531,10 +1531,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_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;
#endif
case __get_functor_ptr: case __get_functor_ptr:
__dest._M_access<_Functor*>() = _M_get_pointer(__source); __dest._M_access<_Functor*>() = _M_get_pointer(__source);
break; break;
...@@ -1596,10 +1597,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -1596,10 +1597,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_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;
#endif
case __get_functor_ptr: case __get_functor_ptr:
__dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source); __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
return is_const<_Functor>::value; return is_const<_Functor>::value;
...@@ -1730,10 +1732,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -1730,10 +1732,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_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;
#endif
case __get_functor_ptr: case __get_functor_ptr:
__dest._M_access<_Functor*>() = __dest._M_access<_Functor*>() =
&_Base::_M_get_pointer(__source)->__value; &_Base::_M_get_pointer(__source)->__value;
...@@ -1935,7 +1938,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -1935,7 +1938,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
* stored by @c this. * stored by @c this.
*/ */
_Res operator()(_ArgTypes... __args) const; _Res operator()(_ArgTypes... __args) const;
#ifdef __GXX_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
...@@ -1961,7 +1965,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -1961,7 +1965,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
/// @overload /// @overload
template<typename _Functor> const _Functor* target() const; template<typename _Functor> const _Functor* target() const;
#endif
private: private:
// [3.7.2.6] undefined operators // [3.7.2.6] undefined operators
template<typename _Function> template<typename _Function>
...@@ -2020,6 +2025,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -2020,6 +2025,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
return _M_invoker(_M_functor, __args...); return _M_invoker(_M_functor, __args...);
} }
#ifdef __GXX_RTTI
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
const type_info& const type_info&
function<_Res(_ArgTypes...)>:: function<_Res(_ArgTypes...)>::
...@@ -2069,6 +2075,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 ...@@ -2069,6 +2075,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
else else
return 0; return 0;
} }
#endif
// [3.7.2.7] null pointer comparisons // [3.7.2.7] null pointer comparisons
......
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