From 796cccfcc36d87e8112972dcbd97e9693f014fc7 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 28 Jul 2005 18:08:59 +0000 Subject: [PATCH] re PR c++/22545 (ICE with pointer to class member & user defined conversion operator) PR c++/22545 * call.c (add_builtin_candidate): Adjust for changes in representation of pointer-to-member types. PR c++/22545 * g++.dg/expr/ptrmem7.C: New test. From-SVN: r102500 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/expr/ptrmem7.C | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/expr/ptrmem7.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 31e3d97e6b8..5a3be7c286c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-07-28 Mark Mitchell + + PR c++/22545 + * call.c (add_builtin_candidate): Adjust for changes in + representation of pointer-to-member types. + 2005-07-28 Mike Stump * pt.c (check_explicit_specialization): Add visibility logic. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 609fe45a382..cdc068c90eb 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1701,7 +1701,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) - || is_complete (TREE_TYPE (TREE_TYPE (type2))))) + || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; } return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64fa8fe6f40..614a8b8229c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-07-28 Mark Mitchell + + PR c++/22545 + * g++.dg/expr/ptrmem7.C: New test. + 2005-07-28 Mike Stump * g++.old-deja/g++.mike/visibility-1.C: New test. diff --git a/gcc/testsuite/g++.dg/expr/ptrmem7.C b/gcc/testsuite/g++.dg/expr/ptrmem7.C new file mode 100644 index 00000000000..a94990e54b7 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/ptrmem7.C @@ -0,0 +1,21 @@ +// PR c++/22545 + +struct A { + int member; + A() : member(13) {} +}; + +A a; + +struct B { + operator A*() { return &a; } +}; + +B b; + +int A::* member_pntr = &A::member; + +int main() +{ + return b ->* member_pntr; +}