Remove struct keyword in range-based for

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.
This commit is contained in:
Simon Marchi 2018-10-03 14:34:18 -04:00
parent f35d5adea1
commit 8634679f82
2 changed files with 6 additions and 1 deletions

View 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> 2018-10-03 Tom Tromey <tom@tromey.com>
* README: Mention --enable-ubsan. * README: Mention --enable-ubsan.

View 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 though they don't appear in this symtab directly, other parts
of gdb assume that symbols do, and this is reasonably of gdb assume that symbols do, and this is reasonably
true. */ true. */
for (struct symbol *sym : template_args) for (symbol *sym : template_args)
symbol_set_symtab (sym, symbol_symtab (templ_func)); symbol_set_symtab (sym, symbol_symtab (templ_func));
} }