typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes from B.
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 4 Mar 1998 11:56:29 +0000 (11:56 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 4 Mar 1998 11:56:29 +0000 (06:56 -0500)
* typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
from B.

From-SVN: r18400

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 014089102406446a33050f5c44702be775204805..582567a4e7e124729482884a278450b8e0ad5746 100644 (file)
@@ -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.
index 137c73520089677f8dca62be867e496f00d53ead..f7aa982dcb5b737a378e9bd7e3b52bde7e2356ad 100644 (file)
@@ -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);
        }
     }