This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/38596


Hi,

sanity-checked x86_64-linux, committed to mainline.

Paolo.

/////////////////
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.
Index: include/tr1_impl/functional
===================================================================
*** include/tr1_impl/functional	(revision 142860)
--- include/tr1_impl/functional	(working copy)
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 1531,1540 ****
  	{
  	  switch (__op)
  	    {
  	    case __get_type_info:
  	      __dest._M_access<const type_info*>() = &typeid(_Functor);
  	      break;
! 
  	    case __get_functor_ptr:
  	      __dest._M_access<_Functor*>() = _M_get_pointer(__source);
  	      break;
--- 1531,1541 ----
  	{
  	  switch (__op)
  	    {
+ #ifdef __GXX_RTTI
  	    case __get_type_info:
  	      __dest._M_access<const type_info*>() = &typeid(_Functor);
  	      break;
! #endif
  	    case __get_functor_ptr:
  	      __dest._M_access<_Functor*>() = _M_get_pointer(__source);
  	      break;
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 1596,1605 ****
  	{
  	  switch (__op)
  	    {
  	    case __get_type_info:
  	      __dest._M_access<const type_info*>() = &typeid(_Functor);
  	      break;
! 	      
  	    case __get_functor_ptr:
  	      __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
  	      return is_const<_Functor>::value;
--- 1597,1607 ----
  	{
  	  switch (__op)
  	    {
+ #ifdef __GXX_RTTI
  	    case __get_type_info:
  	      __dest._M_access<const type_info*>() = &typeid(_Functor);
  	      break;
! #endif
  	    case __get_functor_ptr:
  	      __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
  	      return is_const<_Functor>::value;
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 1730,1739 ****
        {
          switch (__op)
  	  {
  	  case __get_type_info:
  	    __dest._M_access<const type_info*>() = &typeid(_Functor);
  	    break;
! 	    
  	  case __get_functor_ptr:
  	    __dest._M_access<_Functor*>() =
  	      &_Base::_M_get_pointer(__source)->__value;
--- 1732,1742 ----
        {
          switch (__op)
  	  {
+ #ifdef __GXX_RTTI
  	  case __get_type_info:
  	    __dest._M_access<const type_info*>() = &typeid(_Functor);
  	    break;
! #endif	    
  	  case __get_functor_ptr:
  	    __dest._M_access<_Functor*>() =
  	      &_Base::_M_get_pointer(__source)->__value;
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 1935,1941 ****
         *  stored by @c this.
         */
        _Res operator()(_ArgTypes... __args) const;
!       
        // [3.7.2.5] function target access
        /**
         *  @brief Determine the type of the target of this function object
--- 1938,1945 ----
         *  stored by @c this.
         */
        _Res operator()(_ArgTypes... __args) const;
! 
! #ifdef __GXX_RTTI
        // [3.7.2.5] function target access
        /**
         *  @brief Determine the type of the target of this function object
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 1961,1967 ****
        
        /// @overload
        template<typename _Functor> const _Functor* target() const;
!       
      private:
        // [3.7.2.6] undefined operators
        template<typename _Function>
--- 1965,1972 ----
        
        /// @overload
        template<typename _Functor> const _Functor* target() const;
! #endif
! 
      private:
        // [3.7.2.6] undefined operators
        template<typename _Function>
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 2020,2025 ****
--- 2025,2031 ----
        return _M_invoker(_M_functor, __args...);
      }
  
+ #ifdef __GXX_RTTI
    template<typename _Res, typename... _ArgTypes>
      const type_info&
      function<_Res(_ArgTypes...)>::
*************** _GLIBCXX_BEGIN_NAMESPACE_TR1
*** 2069,2074 ****
--- 2075,2081 ----
  	else
  	  return 0;
        }
+ #endif
  
    // [3.7.2.7] null pointer comparisons
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]