aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-09-08 14:12:45 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-09-08 14:12:45 -0400
commitf33ab5c3f104755e1a626136f3d3f00583cfbf3c (patch)
tree9120b33d1225b220ffcf75d41b35ddb2fce665d6
parent02c5ff73d4f5079748e004854024c656c2e6afc9 (diff)
downloadgcc-f33ab5c3f104755e1a626136f3d3f00583cfbf3c.zip
gcc-f33ab5c3f104755e1a626136f3d3f00583cfbf3c.tar.gz
gcc-f33ab5c3f104755e1a626136f3d3f00583cfbf3c.tar.bz2
name-lookup.c (is_class_level): Remove.
* name-lookup.c (is_class_level): Remove. (push_binding_level, leave_scope, resume_scope): Adjust. (pushlevel_class): Adjust. (poplevel_class): Make sure we're on class_binding_level. From-SVN: r151527
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/name-lookup.c16
2 files changed, 8 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 69eb476..20ce758 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-03 Jason Merrill <jason@redhat.com>
+
+ * name-lookup.c (is_class_level): Remove.
+ (push_binding_level, leave_scope, resume_scope): Adjust.
+ (pushlevel_class): Adjust.
+ (poplevel_class): Make sure we're on class_binding_level.
+
2009-09-02 Jason Merrill <jason@redhat.com>
* decl.c (grokmethod): Rename from start_method.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index feb2cf2..4928506 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1257,7 +1257,6 @@ check_for_out_of_scope_variable (tree decl)
static bool keep_next_level_flag;
static int binding_depth = 0;
-static int is_class_level = 0;
static void
indent (int depth)
@@ -1339,7 +1338,6 @@ push_binding_level (struct cp_binding_level *scope)
scope->binding_depth = binding_depth;
indent (binding_depth);
cxx_scope_debug (scope, input_line, "push");
- is_class_level = 0;
binding_depth++;
}
}
@@ -1427,12 +1425,6 @@ leave_scope (void)
{
indent (--binding_depth);
cxx_scope_debug (scope, input_line, "leave");
- if (is_class_level != (scope == class_binding_level))
- {
- indent (binding_depth);
- verbatim ("XXX is_class_level != (current_scope == class_scope)\n");
- }
- is_class_level = 0;
}
/* Move one nesting level up. */
@@ -1482,7 +1474,6 @@ resume_scope (struct cp_binding_level* b)
b->binding_depth = binding_depth;
indent (binding_depth);
cxx_scope_debug (b, input_line, "resume");
- is_class_level = 0;
binding_depth++;
}
}
@@ -2562,9 +2553,6 @@ pop_inner_scope (tree outer, tree inner)
void
pushlevel_class (void)
{
- if (ENABLE_SCOPE_CHECKING)
- is_class_level = 1;
-
class_binding_level = begin_scope (sk_class, current_class_type);
}
@@ -2602,9 +2590,7 @@ poplevel_class (void)
/* Now, pop out of the binding level which we created up in the
`pushlevel_class' routine. */
- if (ENABLE_SCOPE_CHECKING)
- is_class_level = 1;
-
+ gcc_assert (current_binding_level == level);
leave_scope ();
timevar_pop (TV_NAME_LOOKUP);
}