Fix the [-Werror=shadow=local] warning
authorWeimin Pan <weimin.pan@oracle.com>
Mon, 8 Oct 2018 22:14:11 +0000 (22:14 +0000)
committerWeimin Pan <weimin.pan@oracle.com>
Mon, 8 Oct 2018 22:14:11 +0000 (22:14 +0000)
Rename local variable in value_struct_elt_for_reference()
to work around the shadowing a previous local warning.

gdb/ChangeLog
gdb/valops.c

index f074385c30986b756e661379f9928472d3d30379..eac1dc2611206d7e2c27ad60ac94d9b3a10840a8 100644 (file)
@@ -1,3 +1,7 @@
+2018-10-08  Weimin Pan  <weimin.pan@oracle.com>
+       * valops.c (value_struct_elt_for_reference): Rename local variable
+       to work around the shadowing a previous local warning.
+
 2018-10-08  John Baldwin  <jhb@FreeBSD.org>
 
        * Makefile.in (ALLDEPFILES): Add riscv-fbsd-nat.c.
index 99b12751dcab239a714cbde8d4045f0aec5a39a9..c45caefbf1e039d7581a20bb6de589c9bf0ef200 100644 (file)
@@ -3439,9 +3439,9 @@ value_struct_elt_for_reference (struct type *domain, int offset,
                        mem_offset += boff;
                      else
                        {
-                         struct type *t = check_typedef (value_type (this_v));
-                         t = check_typedef (TYPE_TARGET_TYPE (t));
-                         if (get_baseclass_offset (t, curtype, this_v,
+                         struct type *p = check_typedef (value_type (this_v));
+                         p = check_typedef (TYPE_TARGET_TYPE (p));
+                         if (get_baseclass_offset (p, curtype, this_v,
                                                    &boff, &isvirt))
                            mem_offset += boff;
                        }