Commit 8f279ed7 by Jason Merrill Committed by Jason Merrill

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
parent a1da6cba
Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
from B.
Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net> Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
* pt.c (finish_member_template_decl): Deal more gracefully with * pt.c (finish_member_template_decl): Deal more gracefully with
...@@ -5,6 +10,10 @@ Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net> ...@@ -5,6 +10,10 @@ Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com> Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
* 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, * 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 method.c, pt.c, ptree.c, typeck.c: Remove support for
-fno-ansi-overloading and overloading METHOD_CALL_EXPR. -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
......
...@@ -4733,7 +4733,7 @@ unary_complex_lvalue (code, arg) ...@@ -4733,7 +4733,7 @@ unary_complex_lvalue (code, arg)
else else
{ {
tree type; tree type;
tree offset = integer_zero_node; tree offset;
if (TREE_OPERAND (arg, 0) if (TREE_OPERAND (arg, 0)
&& (TREE_CODE (TREE_OPERAND (arg, 0)) != NOP_EXPR && (TREE_CODE (TREE_OPERAND (arg, 0)) != NOP_EXPR
...@@ -4747,29 +4747,21 @@ unary_complex_lvalue (code, arg) ...@@ -4747,29 +4747,21 @@ unary_complex_lvalue (code, arg)
return error_mark_node; 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. */ /* Add in the offset to the field. */
offset = size_binop (PLUS_EXPR, offset, offset = convert (sizetype,
convert (sizetype, size_binop (EASY_DIV_EXPR,
size_binop (EASY_DIV_EXPR, DECL_FIELD_BITPOS (t),
DECL_FIELD_BITPOS (t), size_int (BITS_PER_UNIT)));
size_int (BITS_PER_UNIT))
));
/* We offset all pointer to data members by 1 so that we can /* We offset all pointer to data members by 1 so that we can
distinguish between a null pointer to data member and the first distinguish between a null pointer to data member and the first
data member of a structure. */ data member of a structure. */
offset = size_binop (PLUS_EXPR, offset, size_int (1)); 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);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment