From 8f279ed7be97a4cafd8701062618fb06068793a1 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 4 Mar 1998 11:56:29 +0000 Subject: [PATCH] typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes from B. * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes from B. From-SVN: r18400 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/typeck.c | 26 +++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 01408910240..582567a4e7e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 4 11:47:55 1998 Jason Merrill + + * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes + from B. + Wed Mar 4 11:28:08 1998 Mark Mitchell * pt.c (finish_member_template_decl): Deal more gracefully with @@ -5,6 +10,10 @@ Wed Mar 4 11:28:08 1998 Mark Mitchell Tue Mar 3 01:38:17 1998 Jason Merrill + * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c, + cp-tree.h: Clean up more old overloading code, old RTTI code, and + some formatting quirks. + * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c, method.c, pt.c, ptree.c, typeck.c: Remove support for -fno-ansi-overloading and overloading METHOD_CALL_EXPR. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 137c7352008..f7aa982dcb5 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4733,7 +4733,7 @@ unary_complex_lvalue (code, arg) else { tree type; - tree offset = integer_zero_node; + tree offset; if (TREE_OPERAND (arg, 0) && (TREE_CODE (TREE_OPERAND (arg, 0)) != NOP_EXPR @@ -4747,29 +4747,21 @@ unary_complex_lvalue (code, arg) return error_mark_node; } - type = TYPE_OFFSET_BASETYPE (TREE_TYPE (arg)); - - /* Now in the offset to the final subobject. */ - offset = size_binop (PLUS_EXPR, - offset, - get_delta_difference (DECL_FIELD_CONTEXT (t), - type, - 0)); - /* Add in the offset to the field. */ - offset = size_binop (PLUS_EXPR, offset, - convert (sizetype, - size_binop (EASY_DIV_EXPR, - DECL_FIELD_BITPOS (t), - size_int (BITS_PER_UNIT)) - )); + offset = convert (sizetype, + size_binop (EASY_DIV_EXPR, + DECL_FIELD_BITPOS (t), + size_int (BITS_PER_UNIT))); /* We offset all pointer to data members by 1 so that we can distinguish between a null pointer to data member and the first data member of a structure. */ offset = size_binop (PLUS_EXPR, offset, size_int (1)); - return cp_convert (build_pointer_type (TREE_TYPE (arg)), offset); + type = build_offset_type (DECL_FIELD_CONTEXT (t), TREE_TYPE (t)); + type = build_pointer_type (type); + + return cp_convert (type, offset); } } -- 2.30.2