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
This commit is contained in:
Jason Merrill 1998-05-10 18:53:45 -04:00
parent e9b4fabf5c
commit 42c7b8075d
6 changed files with 39 additions and 4 deletions

View 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.

View 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'",

View 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. */

View 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);
}

View 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);

View 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);