Remove struct keyword in range-based for
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 3 Oct 2018 18:34:18 +0000 (14:34 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 3 Oct 2018 21:51:35 +0000 (17:51 -0400)
I get the following error with gcc 6.3.0:

/home/simark/src/binutils-gdb/gdb/dwarf2read.c: In function 'void read_func_scope(die_info*, dwarf2_cu*)':
/home/simark/src/binutils-gdb/gdb/dwarf2read.c:13838:12: error: types may not be defined in a for-range-declaration [-Werror]
       for (struct symbol *sym : template_args)
            ^~~~~~

Removing the struct keyword fixes it.

gdb/ChangeLog:

* dwarf2read.c (read_func_scope): Remove struct keyword in
range-based for.

gdb/ChangeLog
gdb/dwarf2read.c

index 57b85dce76d51ed90d10f7b56ea7647496d319cf..77531109a42e1aedf16704876be5f17172ab0b0d 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-03  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * dwarf2read.c (read_func_scope): Remove struct keyword in
+       range-based for.
+
 2018-10-03  Tom Tromey  <tom@tromey.com>
 
        * README: Mention --enable-ubsan.
index 7004299a914665f1f2e9c39e235a80f3f1a3c44f..929a8be738747411d99b464452b9013a377bb3d4 100644 (file)
@@ -13835,7 +13835,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
         though they don't appear in this symtab directly, other parts
         of gdb assume that symbols do, and this is reasonably
         true.  */
-      for (struct symbol *sym : template_args)
+      for (symbol *sym : template_args)
        symbol_set_symtab (sym, symbol_symtab (templ_func));
     }