This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[C++ PATCH]: Fix 11766


Hi,
I've installed this obvious fix for 11766, a breakage from the OFFSET_TYPE
change. We'd loop on pointers to member functions too.

booted & tested on i686-pc-linux-gnu.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-08-03  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/11766
	* typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to
	member functions.

Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.489
diff -c -3 -p -r1.489 typeck.c
*** cp/typeck.c	1 Aug 2003 09:16:07 -0000	1.489
--- cp/typeck.c	3 Aug 2003 14:16:47 -0000
*************** comp_ptr_ttypes_real (tree to, tree from
*** 6030,6036 ****
  	    constp &= TYPE_READONLY (to);
  	}
  
!       if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTR_TO_MEMBER_P (to))
  	return ((constp >= 0 || to_more_cv_qualified)
  		&& same_type_ignoring_top_level_qualifiers_p (to, from));
      }
--- 6030,6036 ----
  	    constp &= TYPE_READONLY (to);
  	}
  
!       if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
  	return ((constp >= 0 || to_more_cv_qualified)
  		&& same_type_ignoring_top_level_qualifiers_p (to, from));
      }
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>

// PR 11766. ICE

template<typename T>
struct normal_iterator
{
  normal_iterator(const T& __i);
};


template<typename _Tp>
struct vector
{
  void end() const {  normal_iterator<const _Tp*> (this->pt); }
  void size() const { end(); }
  _Tp* pt;
};
  


struct MuonTag {
  typedef void (MuonTag::*Selector)();
};

void foo()
{
  vector<MuonTag::Selector> _selectors;
  _selectors.size();
}

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