Commit ae0b7dfc by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/11766 (ICE in comp_ptr_ttypes_real)

cp:
	PR c++/11766
	* typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to
	member functions.
testsuite:
	PR c++/11766
	* g++.dg/expr/ptrmem1.C: New test.

From-SVN: r70118
parent cb6eb88a
...@@ -6030,7 +6030,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp) ...@@ -6030,7 +6030,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
constp &= TYPE_READONLY (to); constp &= TYPE_READONLY (to);
} }
if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTR_TO_MEMBER_P (to)) if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
return ((constp >= 0 || to_more_cv_qualified) return ((constp >= 0 || to_more_cv_qualified)
&& same_type_ignoring_top_level_qualifiers_p (to, from)); && same_type_ignoring_top_level_qualifiers_p (to, from));
} }
......
2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11766
* g++.dg/expr/ptrmem1.C: New test.
2003-08-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2003-08-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9453 PR c++/9453
......
// { 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();
}
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