From 63f0e930d4667eb7dbc95c78f770cd58acd328ef Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 16 Oct 2017 13:39:12 +0100 Subject: Work around GCC 6.3.1 bug This commit works around a GCC 6.3.1 bug several people are hitting: https://sourceware.org/ml/gdb-patches/2017-09/msg00270.html https://sourceware.org/ml/gdb-patches/2017-10/msg00418.html It manifests like this: ../../../binutils-gdb/gdb/probe.c:68:12: error: types may not be defined in a for-range-declaration [-Werror] for (struct probe *probe : probes) ^~~~~~ Fix it by renaming the range-for named variables to something different from their type's name. gdb/ChangeLog: 2017-10-16 Pedro Alves * elfread.c (probe_key_free): Rename range-for variable. * probe.c (parse_probes_in_pspace, find_probes_in_objfile) (find_probe_by_pc, collect_probes): Rename range-for variable. --- gdb/elfread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/elfread.c') diff --git a/gdb/elfread.c b/gdb/elfread.c index 436d9b5..4e11071 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1340,8 +1340,8 @@ probe_key_free (bfd *abfd, void *d) { std::vector *probes = (std::vector *) d; - for (struct probe *probe : *probes) - probe->pops->destroy (probe); + for (probe *p : *probes) + p->pops->destroy (p); delete probes; } -- cgit v1.1