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
This commit is contained in:
parent
cb6eb88a2e
commit
ae0b7dfc7e
@ -6030,7 +6030,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
|
||||
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)
|
||||
&& same_type_ignoring_top_level_qualifiers_p (to, from));
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR c++/9453
|
||||
|
33
gcc/testsuite/g++.dg/expr/ptrmem1.C
Normal file
33
gcc/testsuite/g++.dg/expr/ptrmem1.C
Normal file
@ -0,0 +1,33 @@
|
||||
// { 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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user