This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]