diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-08-03 14:19:00 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-08-03 14:19:00 +0000 |
commit | ae0b7dfc7e9084c45901687320a7d9d285a530ba (patch) | |
tree | d0abbc6ab85bb14480657c29e9b238534afdf50a /gcc | |
parent | cb6eb88a2ee8b9edf00ca0c64deb94940e18fa41 (diff) | |
download | gcc-ae0b7dfc7e9084c45901687320a7d9d285a530ba.zip gcc-ae0b7dfc7e9084c45901687320a7d9d285a530ba.tar.gz gcc-ae0b7dfc7e9084c45901687320a7d9d285a530ba.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/typeck.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/ptrmem1.C | 33 |
3 files changed, 39 insertions, 1 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index dd7e0af..d450d0a 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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)); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e1fa217..61d9742 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/expr/ptrmem1.C b/gcc/testsuite/g++.dg/expr/ptrmem1.C new file mode 100644 index 0000000..146143a --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/ptrmem1.C @@ -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(); +} |