Commit a7d2d407 by Mark Mitchell Committed by Mark Mitchell

decl.c (lookup_name_current_level): Tweak, and improve documentation.

	* decl.c (lookup_name_current_level): Tweak, and improve
	documentation.

From-SVN: r26210
parent 7c72138a
1999-04-05 Mark Mitchell <mark@codesourcery.com>
* decl.c (lookup_name_current_level): Tweak, and improve
documentation.
* class.c (maybe_fixup_vptrs): Remove declaration.
(build_class_init_list): Likewise.
* decl.c (pushdecl_class_level): Call check_template_shadow here
......
......@@ -5727,15 +5727,21 @@ lookup_name (name, prefer_type)
return lookup_name_real (name, prefer_type, 0, 0);
}
/* Similar to `lookup_name' but look only at current binding level. */
/* Similar to `lookup_name' but look only in the innermost non-class
binding level. */
tree
lookup_name_current_level (name)
tree name;
{
register tree t = NULL_TREE;
struct binding_level *b;
tree t = NULL_TREE;
b = current_binding_level;
while (b->parm_flag == 2)
b = b->level_chain;
if (current_binding_level->namespace_p)
if (b->namespace_p)
{
t = IDENTIFIER_NAMESPACE_VALUE (name);
......@@ -5746,8 +5752,6 @@ lookup_name_current_level (name)
else if (IDENTIFIER_BINDING (name)
&& LOCAL_BINDING_P (IDENTIFIER_BINDING (name)))
{
struct binding_level *b = current_binding_level;
while (1)
{
if (BINDING_LEVEL (IDENTIFIER_BINDING (name)) == b)
......
// Build don't link:
// Origin: Jason Merrill <jason@cygnus.com>
int main()
{
void f();
class A {
friend void f();
};
}
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