OSDN Git Service

* class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 May 1998 22:53:45 +0000 (22:53 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 May 1998 22:53:45 +0000 (22:53 +0000)
* decl2.c (constructor_name_full): Likewise.
* tree.c (mapcar): Add OVERLOAD support.
* init.c (resolve_offset_ref): We must use basetype_path before we
destroy it with a call to convert_pointer_to.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19656 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/init.c
gcc/cp/tree.c

index 0006972..61ea235 100644 (file)
@@ -1,3 +1,15 @@
+Sun May 10 22:48:22 1998  H.J. Lu  (hjl@gnu.org)
+
+       * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
+       * decl2.c (constructor_name_full): Likewise.
+
+Sun May 10 22:48:12 1998  Mike Stump  <mrs@wrs.com>
+
+       * tree.c (mapcar): Add OVERLOAD support.
+
+       * init.c (resolve_offset_ref): We must use basetype_path before we
+       destroy it with a call to convert_pointer_to.
+
 Sat May  9 14:44:37 1998  Jason Merrill  <jason@yorick.cygnus.com>
 
        * class.c (currently_open_class): New fn.
index 0e3e3cd..9ba2824 100644 (file)
@@ -3705,7 +3705,8 @@ finish_struct_1 (t, warn_anon)
        name = DECL_NAME (fdecl);
 
        for (; i < n_methods; i++)
-         if (DECL_NAME (TREE_VEC_ELT (method_vec, i)) == name)
+         if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
+               == name)
            {
              cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
              cp_error_at ("  because of local method `%#D' with same name",
@@ -3821,7 +3822,8 @@ finish_struct_1 (t, warn_anon)
            continue;
 
          for (; i < n_methods; ++i)
-           if (DECL_NAME (TREE_VEC_ELT (method_vec, i)) == name)
+           if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
+               == name)
              {
                cp_error_at ("data member `%#D' conflicts with", x);
                cp_error_at ("function member `%#D'",
index 9c90531..662ba15 100644 (file)
@@ -1097,6 +1097,16 @@ struct lang_decl
   ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \
    ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE))
 
+/* 1 iff NODE has namespace scope, including the global namespace.  */
+#define DECL_NAMESPACE_SCOPE(NODE) \
+  (DECL_CONTEXT (NODE) == NULL_TREE \
+   || TREE_CODE (DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
+
+/* 1 iff NODE is a class member.  */
+#define DECL_CLASS_SCOPE(NODE) \
+  (DECL_CONTEXT (NODE) \
+   && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't')
+
 /* For a NAMESPACE_DECL: the list of using namespace directives
    The PURPOSE is the used namespace, the value is the namespace
    that is the common ancestor. */
index 3d6dc25..927efb8 100644 (file)
@@ -1982,7 +1982,7 @@ constructor_name_full (thing)
   else if (IS_AGGR_TYPE_CODE (TREE_CODE (thing)))
     {
       if (TYPE_WAS_ANONYMOUS (thing) && TYPE_HAS_CONSTRUCTOR (thing))
-       thing = DECL_NAME (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (thing), 0));
+       thing = DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (thing), 0)));
       else
        thing = TYPE_NAME (thing);
     }
index b92f79d..d7a94ae 100644 (file)
@@ -1870,8 +1870,10 @@ resolve_offset_ref (exp)
          error_not_base_type (basetype, TREE_TYPE (TREE_TYPE (base)));
          return error_mark_node;
        }
-      addr = convert_pointer_to (basetype, base);
+      /* Kludge: we need to use basetype_path now, because
+        convert_pointer_to will bash it.  */
       access = compute_access (basetype_path, member);
+      addr = convert_pointer_to (basetype, base);
       if (access == access_public_node)
        return build (COMPONENT_REF, TREE_TYPE (member),
                      build_indirect_ref (addr, NULL_PTR), member);
index 4b2c82d..2d07eee 100644 (file)
@@ -1590,6 +1590,15 @@ mapcar (t, func)
        return t;
       }
 
+    case OVERLOAD:
+      {
+       tree chain = OVL_CHAIN (t);
+       t = copy_node (t);
+       OVL_FUNCTION (t) = mapcar (OVL_FUNCTION (t), func);
+       OVL_CHAIN (t) = mapcar (chain, func);
+       return t;
+      }
+
     case TREE_VEC:
       {
        int len = TREE_VEC_LENGTH (t);