public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [pushed] Remove struct keyword in range-based for
Date: Wed, 03 Oct 2018 21:53:00 -0000	[thread overview]
Message-ID: <20181003215310.16614-1-simon.marchi@polymtl.ca> (raw)

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    | 5 +++++
 gdb/dwarf2read.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 57b85dce76d5..77531109a42e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7004299a9146..929a8be73874 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -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));
     }
 
-- 
2.19.0

                 reply	other threads:[~2018-10-03 21:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003215310.16614-1-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).