I wanted this when messing with binding levels for 86969.  This function is
only used interactively from the debugger, so it's safe to go in now.

---
 gcc/cp/name-lookup.c | 2 ++
 gcc/cp/ChangeLog     | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 2e1b851341b..1ddcde26ef4 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3589,6 +3589,8 @@ print_binding_level (cp_binding_level* lvl)
 {
   tree t;
   int i = 0, len;
+  if (lvl->this_entity)
+    print_node_brief (stderr, "entity=", lvl->this_entity, 1);
   fprintf (stderr, " blocks=%p", (void *) lvl->blocks);
   if (lvl->more_cleanups_ok)
     fprintf (stderr, " more-cleanups-ok");
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8ad0f221efc..3124aa9e02f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-28  Jason Merrill  <ja...@redhat.com>
+
+       * name-lookup.c (print_binding_level): Print this_entity.
+
 2019-02-27  Marek Polacek  <pola...@redhat.com>
 
        PR c++/88857 - ICE with value-initialization of argument in template.

base-commit: 35e99d5d3bd98eb2e2cee5d94ba09b6166dbeab2
-- 
2.20.1

Reply via email to