Commit 0034cf72 by Jason Merrill Committed by Jason Merrill

tree.c (equal_functions): Fix name in prototype.

	* tree.c (equal_functions): Fix name in prototype.
	* decl.c (push_local_binding): Add FLAGS argument.
	(pushdecl, push_overloaded_decl): Pass it.
	* decl2.c (do_local_using_decl): Likewise.
	* cp-tree.h: Adjust prototype.
	* decl.c (poplevel): Fix logic.

From-SVN: r24869
parent 4a6330ac
1999-01-26 Jason Merrill <jason@yorick.cygnus.com> 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (equal_functions): Fix name in prototype.
* decl.c (push_local_binding): Add FLAGS argument.
(pushdecl, push_overloaded_decl): Pass it.
* decl2.c (do_local_using_decl): Likewise.
* cp-tree.h: Adjust prototype.
* decl.c (poplevel): Fix logic.
* decl.c (push_local_binding): Also wrap used decls in a TREE_LIST. * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
(poplevel): Handle that. Fix logic for removing TREE_LISTs. (poplevel): Handle that. Fix logic for removing TREE_LISTs.
(cat_namespace_levels): Don't loop forever. (cat_namespace_levels): Don't loop forever.
......
...@@ -2822,7 +2822,7 @@ extern void revert_static_member_fn PROTO((tree*, tree*, tree*)); ...@@ -2822,7 +2822,7 @@ extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
extern void cat_namespace_levels PROTO((void)); extern void cat_namespace_levels PROTO((void));
extern void fixup_anonymous_union PROTO((tree)); extern void fixup_anonymous_union PROTO((tree));
extern int check_static_variable_definition PROTO((tree, tree)); extern int check_static_variable_definition PROTO((tree, tree));
extern void push_local_binding PROTO((tree, tree)); extern void push_local_binding PROTO((tree, tree, int));
extern void push_class_binding PROTO((tree, tree)); extern void push_class_binding PROTO((tree, tree));
extern tree check_default_argument PROTO((tree, tree)); extern tree check_default_argument PROTO((tree, tree));
extern tree push_overloaded_decl PROTO((tree, int)); extern tree push_overloaded_decl PROTO((tree, int));
......
...@@ -1117,12 +1117,15 @@ add_binding (id, decl) ...@@ -1117,12 +1117,15 @@ add_binding (id, decl)
} }
} }
/* Bind DECL to ID in the current_binding_level. */ /* Bind DECL to ID in the current_binding_level.
If PUSH_USING is set in FLAGS, we know that DECL doesn't really belong
to this binding level, that it got here through a using-declaration. */
void void
push_local_binding (id, decl) push_local_binding (id, decl, flags)
tree id; tree id;
tree decl; tree decl;
int flags;
{ {
tree d = decl; tree d = decl;
...@@ -1133,8 +1136,7 @@ push_local_binding (id, decl) ...@@ -1133,8 +1136,7 @@ push_local_binding (id, decl)
/* Create a new binding. */ /* Create a new binding. */
push_binding (id, d, current_binding_level); push_binding (id, d, current_binding_level);
if (TREE_CODE (decl) == OVERLOAD if (TREE_CODE (decl) == OVERLOAD || (flags & PUSH_USING))
|| (DECL_P (decl) && DECL_NAMESPACE_SCOPE_P (decl)))
/* We must put the OVERLOAD into a TREE_LIST since the /* We must put the OVERLOAD into a TREE_LIST since the
TREE_CHAIN of an OVERLOAD is already used. Similarly for TREE_CHAIN of an OVERLOAD is already used. Similarly for
decls that got here through a using-declaration. */ decls that got here through a using-declaration. */
...@@ -1425,12 +1427,13 @@ poplevel (keep, reverse, functionbody) ...@@ -1425,12 +1427,13 @@ poplevel (keep, reverse, functionbody)
else else
{ {
/* Remove the binding. */ /* Remove the binding. */
if (TREE_CODE (link) == TREE_LIST) decl = link;
link = TREE_VALUE (link); if (TREE_CODE (decl) == TREE_LIST)
if (TREE_CODE_CLASS (TREE_CODE (link)) == 'd') decl = TREE_VALUE (decl);
pop_binding (DECL_NAME (link), link); if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
else if (TREE_CODE (link) == OVERLOAD) pop_binding (DECL_NAME (decl), decl);
pop_binding (DECL_NAME (OVL_FUNCTION (link)), link); else if (TREE_CODE (decl) == OVERLOAD)
pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl);
else else
my_friendly_abort (0); my_friendly_abort (0);
} }
...@@ -3798,7 +3801,7 @@ pushdecl (x) ...@@ -3798,7 +3801,7 @@ pushdecl (x)
if (need_new_binding) if (need_new_binding)
{ {
push_local_binding (name, x); push_local_binding (name, x, 0);
/* Because push_local_binding will hook X on to the /* Because push_local_binding will hook X on to the
current_binding_level's name list, we don't want to current_binding_level's name list, we don't want to
do that again below. */ do that again below. */
...@@ -4296,7 +4299,7 @@ push_overloaded_decl (decl, flags) ...@@ -4296,7 +4299,7 @@ push_overloaded_decl (decl, flags)
} }
/* Install the new binding. */ /* Install the new binding. */
push_local_binding (name, new_binding); push_local_binding (name, new_binding, flags);
} }
return decl; return decl;
......
...@@ -4900,7 +4900,7 @@ do_local_using_decl (decl) ...@@ -4900,7 +4900,7 @@ do_local_using_decl (decl)
PUSH_LOCAL | PUSH_USING); PUSH_LOCAL | PUSH_USING);
} }
else else
push_local_binding (name, newval); push_local_binding (name, newval, PUSH_USING);
} }
if (newtype) if (newtype)
set_identifier_type_value (name, newtype); set_identifier_type_value (name, newtype);
......
...@@ -41,7 +41,7 @@ static tree list_hash_lookup PROTO((int, int, int, int, tree, tree, ...@@ -41,7 +41,7 @@ static tree list_hash_lookup PROTO((int, int, int, int, tree, tree,
static void propagate_binfo_offsets PROTO((tree, tree)); static void propagate_binfo_offsets PROTO((tree, tree));
static int avoid_overlap PROTO((tree, tree)); static int avoid_overlap PROTO((tree, tree));
static int lvalue_p_1 PROTO((tree, int)); static int lvalue_p_1 PROTO((tree, int));
static int equal_function PROTO((tree, tree)); static int equal_functions PROTO((tree, tree));
#define CEIL(x,y) (((x) + (y) - 1) / (y)) #define CEIL(x,y) (((x) + (y) - 1) / (y))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment