Remove struct keyword in range-based for-loop
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 20 Jun 2018 16:40:54 +0000 (12:40 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 20 Jun 2018 16:40:54 +0000 (12:40 -0400)
Fix this with gcc 6.3.0, and make the loop variable const while at it:

/home/simark/src/binutils-gdb/gdb/record-full.c: In member function 'virtual int record_full_target::insert_breakpoint(gdbarch*, bp_target_info*)':
/home/simark/src/binutils-gdb/gdb/record-full.c:1789:8: error: types may not be defined in a for-range-declaration [-Werror]
   for (struct record_full_breakpoint &bp : record_full_breakpoints)

gdb/ChangeLog:

* record-full.c (record_full_target::insert_breakpoint): Remove
"struct" keyword, add const.

gdb/ChangeLog
gdb/record-full.c

index c66b686d6b18174e6eafcb5cf73c6664469d9d4e..ff304feff521b6a3eae2f1f1f78f1abea6c25145 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-20  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * record-full.c (record_full_target::insert_breakpoint): Remove
+       "struct" keyword, add const.
+
 2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>
 
        * common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
index a1bc017d961cb8c1e32980f6dfa2cab33eadd496..6465ab537d30826a510e1a2c030f17be8b8507f7 100644 (file)
@@ -1786,7 +1786,7 @@ record_full_target::insert_breakpoint (struct gdbarch *gdbarch,
   /* Use the existing entries if found in order to avoid duplication
      in record_full_breakpoints.  */
 
-  for (struct record_full_breakpoint &bp : record_full_breakpoints)
+  for (const record_full_breakpoint &bp : record_full_breakpoints)
     {
       if (bp.addr == bp_tgt->placed_address
          && bp.address_space == bp_tgt->placed_address_space)