summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-10 22:53:45 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-10 22:53:45 +0000
commitd0fbc643218c6344d288c9437fc538fd3a15a173 (patch)
tree8bbfdafa3182cb814da4233f2db184d2d0875b40
parent8564ad21d5bbb3e41ddbb083a44e3b67bc4b1439 (diff)
downloadgcc-d0fbc643218c6344d288c9437fc538fd3a15a173.tar.gz
* class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
* 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
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/class.c6
-rw-r--r--gcc/cp/cp-tree.h10
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/init.c4
-rw-r--r--gcc/cp/tree.c9
6 files changed, 39 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0006972b434..61ea2355fe4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 0e3e3cde124..9ba28245940 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -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'",
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 9c90531eb60..662ba152f96 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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. */
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3d6dc2510bf..927efb89563 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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);
}
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index b92f79da247..d7a94aecefc 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -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);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4b2c82deffa..2d07eee7d31 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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);