re PR c++/53055 (ICE in cp_build_indirect_ref, at cp/typeck.c:2836)

2012-10-12  Marc Glisse  <marc.glisse@inria.fr>

	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
This commit is contained in:
Marc Glisse 2012-10-12 16:14:37 +02:00 committed by Marc Glisse
parent 7e4dd63d9d
commit 5e54f81df1
7 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-10-12 Marc Glisse <marc.glisse@inria.fr>
PR c++/53055
* c-common.h (enum ref_operator) [RO_ARROW_STAR]: New.
2012-10-11 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (dump_ada_template): Bail out for template declarations

View File

@ -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. */

View File

@ -1,3 +1,9 @@
2012-10-12 Marc Glisse <marc.glisse@inria.fr>
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 <jason@redhat.com>
* cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.

View File

@ -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);

View File

@ -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 ();
}

View File

@ -1,3 +1,8 @@
2012-10-12 Marc Glisse <marc.glisse@inria.fr>
PR c++/53055
* g++.dg/pr53055.C: New testcase.
2012-10-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52744

View File

@ -0,0 +1,5 @@
// PR c++/53055
// { dg-do compile }
struct A A :: * p ;
int i = p ->* p ; // { dg-error "" }