From: Marc Glisse Date: Fri, 12 Oct 2012 14:14:37 +0000 (+0200) Subject: re PR c++/53055 (ICE in cp_build_indirect_ref, at cp/typeck.c:2836) X-Git-Tag: misc/gccgo-go1_1_2~205 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e54f81df1b2336a3ddc4f77180f4e579436b663;p=thirdparty%2Fgcc.git re PR c++/53055 (ICE in cp_build_indirect_ref, at cp/typeck.c:2836) 2012-10-12 Marc Glisse PR c++/53055 gcc/c-family/ * c-common.h (enum ref_operator) [RO_ARROW_STAR]: New. gcc/cp/ * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref. * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR. gcc/testsuite/ * g++.dg/pr53055.C: New testcase. From-SVN: r192401 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 04b6971fef76..c740e4493839 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2012-10-12 Marc Glisse + + PR c++/53055 + * c-common.h (enum ref_operator) [RO_ARROW_STAR]: New. + 2012-10-11 Eric Botcazou * c-ada-spec.c (dump_ada_template): Bail out for template declarations diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index cb18b4e0747f..66d90a345709 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -477,7 +477,9 @@ typedef enum ref_operator { /* -> */ RO_ARROW, /* implicit conversion */ - RO_IMPLICIT_CONVERSION + RO_IMPLICIT_CONVERSION, + /* ->* */ + RO_ARROW_STAR } ref_operator; /* Information about a statement tree. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 549ddbdc3198..ad765412832f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-12 Marc Glisse + + PR c++/53055 + * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref. + * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR. + 2012-10-11 Jason Merrill * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 3351a585f2b4..c94bbbe3c08d 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5309,7 +5309,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1, return cp_build_array_ref (input_location, arg1, arg2, complain); case MEMBER_REF: - return build_m_component_ref (cp_build_indirect_ref (arg1, RO_NULL, + return build_m_component_ref (cp_build_indirect_ref (arg1, RO_ARROW_STAR, complain), arg2, complain); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 13e75ab9ebf2..eaa0935dc986 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2908,6 +2908,10 @@ cp_build_indirect_ref (tree ptr, ref_operator errorstring, case RO_IMPLICIT_CONVERSION: error ("invalid use of implicit conversion on pointer to member"); break; + case RO_ARROW_STAR: + error ("left hand operand of %<->*%> must be a pointer to class, " + "but is a pointer to member of type %qT", type); + break; default: gcc_unreachable (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9f3d29906f9a..3b9f121baea2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-10-12 Marc Glisse + + PR c++/53055 + * g++.dg/pr53055.C: New testcase. + 2012-10-12 Paolo Carlini PR c++/52744 diff --git a/gcc/testsuite/g++.dg/pr53055.C b/gcc/testsuite/g++.dg/pr53055.C new file mode 100644 index 000000000000..787af9d156f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr53055.C @@ -0,0 +1,5 @@ +// PR c++/53055 +// { dg-do compile } + +struct A A :: * p ; +int i = p ->* p ; // { dg-error "" }