From: Nathan Sidwell Date: Sun, 3 Aug 2003 14:19:00 +0000 (+0000) Subject: re PR c++/11766 (ICE in comp_ptr_ttypes_real) X-Git-Tag: releases/gcc-3.4.0~4416 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae0b7dfc7e9084c45901687320a7d9d285a530ba;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index dd7e0af8084b..d450d0ad1c2b 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 e1fa217f1fc4..61d9742f90dc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-08-03 Nathan Sidwell + + PR c++/11766 + * g++.dg/expr/ptrmem1.C: New test. + 2003-08-03 Kriang Lerdsuwanakij 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 000000000000..146143a1e825 --- /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 + +// PR 11766. ICE + +template +struct normal_iterator +{ + normal_iterator(const T& __i); +}; + + +template +struct vector +{ + void end() const { normal_iterator (this->pt); } + void size() const { end(); } + _Tp* pt; +}; + + + +struct MuonTag { + typedef void (MuonTag::*Selector)(); +}; + +void foo() +{ + vector _selectors; + _selectors.size(); +}