aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-03-04 11:56:29 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-03-04 06:56:29 -0500
commit8f279ed7be97a4cafd8701062618fb06068793a1 (patch)
treec0ce379d9329ca054c35fdef7909677fe998e1f4 /gcc
parenta1da6cbacfac48657e23fe42e44ee8bb635314f3 (diff)
downloadgcc-8f279ed7be97a4cafd8701062618fb06068793a1.zip
gcc-8f279ed7be97a4cafd8701062618fb06068793a1.tar.gz
gcc-8f279ed7be97a4cafd8701062618fb06068793a1.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/typeck.c26
2 files changed, 18 insertions, 17 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0140891..582567a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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>
* 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>
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,
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 137c735..f7aa982 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);
}
}