This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH to add assert to push_class_level_binding
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 21 Sep 2009 12:11:10 -0400
- Subject: C++ PATCH to add assert to push_class_level_binding
For a while this condition was not being met on the lambdas branch, and
it seems worth checking.
Tested x86_64-pc-linux-gnu, applied to trunk.
commit 48a3ae19dac97eac82b04ed0b95c0c1db8074ef0
Author: Jason Merrill <jason@redhat.com>
Date: Mon Sep 21 11:28:01 2009 -0400
* name-lookup.c (push_class_level_binding): Sanity check.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 4928506..d37cf44 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2751,6 +2751,9 @@ push_class_level_binding (tree name, tree x)
/* Check for invalid member names. */
gcc_assert (TYPE_BEING_DEFINED (current_class_type));
+ /* Check that we're pushing into the right binding level. */
+ gcc_assert (current_class_type == class_binding_level->this_entity);
+
/* We could have been passed a tree list if this is an ambiguous
declaration. If so, pull the declaration out because
check_template_shadow will not handle a TREE_LIST. */