diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1998-05-10 18:53:45 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-05-10 18:53:45 -0400 |
commit | 42c7b8075de9ae4425e3065c2bb07764f636aadc (patch) | |
tree | 8bbfdafa3182cb814da4233f2db184d2d0875b40 /gcc | |
parent | e9b4fabf5c41bdec0be36e37df4ff8abb4e8c346 (diff) | |
download | gcc-42c7b8075de9ae4425e3065c2bb07764f636aadc.zip gcc-42c7b8075de9ae4425e3065c2bb07764f636aadc.tar.gz gcc-42c7b8075de9ae4425e3065c2bb07764f636aadc.tar.bz2 |
class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
* 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.
From-SVN: r19656
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 10 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/init.c | 4 | ||||
-rw-r--r-- | gcc/cp/tree.c | 9 |
6 files changed, 39 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0006972..61ea235 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 0e3e3cd..9ba2824 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 9c90531..662ba15 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 3d6dc25..927efb8 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 b92f79d..d7a94ae 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 4b2c82d..2d07eee 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); |