From patchwork Thu Dec 7 18:41:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 24786 Received: (qmail 42172 invoked by alias); 7 Dec 2017 18:42:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 42160 invoked by uid 89); 7 Dec 2017 18:42:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=troubles X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Dec 2017 18:42:01 +0000 Received: by mail-wm0-f43.google.com with SMTP id 64so14556387wme.3 for ; Thu, 07 Dec 2017 10:42:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=k+OJIWDrKR7lmAP9nCkfAus4gTZiBGZvFx7lCDsniuA=; b=Y+CdjIABQgtdfU/BYYlPOGpDOxby/Q+bECqOiivfEKcadu9d8CgqTGV1XVkSruR2Km 1BCY4xRRSuidEdxZFTun/+HD4LDxlkK2GGhr/s1lt81Rfop+Rnoctx1RGsQ3yZVDvAxz ypZsa8xU0+j+PsVNxzTdE+UGcRUSD6GCeO9yt+Qrx6eJ8RSmbEI6hj+LyZdOZx+MEkyF +2wkllhF54tYLeKCpQhQJqNMsVc6yFqzXnXgdrhJdQqvMMr8dT8icE4pbUsHr2+RH9Cu LQ1gtUwZcQtDBfTCQWPWp5il/e6GnHOXWBp8fKgfUSVy7mFc1Fkirw1g+apSFF0cSwck dC3g== X-Gm-Message-State: AKGB3mK3DiEO82js2VZwRRPFuho/ipWm2KsracogVqOOH8g48DWeIPP/ 09d0PlueSbkoA9ZYvjiSLtY59F9lmm4= X-Google-Smtp-Source: AGs4zMZC0agw2EiNd++Tm8e8Banss9MYT0Mi1avKFIWpokKF03iL/BZyYPHf9DvixuQ/+KnfuZMAJA== X-Received: by 10.28.145.141 with SMTP id t135mr2117424wmd.107.1512672119195; Thu, 07 Dec 2017 10:41:59 -0800 (PST) Received: from [192.168.0.123] (bl20-178-16.dsl.telepac.pt. [2.81.178.16]) by smtp.gmail.com with ESMTPSA id p90sm6168741wmf.3.2017.12.07.10.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 10:41:58 -0800 (PST) To: GDB Patches Cc: Adam Stylinski From: Pedro Alves Subject: [pushed] Fix build with g++ 6.3.1 Message-ID: Date: Thu, 7 Dec 2017 18:41:57 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 FYI, I've pushed this patch from Adam, which he attached to PR c++/21222, fixing yet another case of g++ 6.3.1's troubles with range-for: https://sourceware.org/ml/gdb-patches/2017-10/msg00442.html From 23a8d1862b7e5b95f0fe9d724c6be326e545e6d1 Mon Sep 17 00:00:00 2001 From: Adam Stylinski Date: Thu, 7 Dec 2017 12:51:03 -0500 Subject: [PATCH] Fix build with g++ 6.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With g++ 6.3.1: target-descriptions.c: In member function ‘virtual void print_c_tdesc::visit_pre(const target_desc*)’: target-descriptions.c:1836:16: error: types may not be defined in a for-range-declaration [-Werror] for (const struct bfd_arch_info *compatible : e->compatible) ^~~~~~ I think at some point the forward declaration of this struct had been removed and declared as a typedef. This fixes that. gdb/ChangeLog: 2017-12-07 Adam Stylinski PR c++/21222 * target-descriptions.c (print_c_tdesc::visit_pre): Change type of range-for variable. --- gdb/ChangeLog | 6 ++++++ gdb/target-descriptions.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 54aec7f..8344f6e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-12-07 Adam Stylinski + + PR c++/21222 + * target-descriptions.c (print_c_tdesc::visit_pre): Change type of + range-for variable. + 2017-12-07 Simon Marchi * common/selftest.h (struct selftest): Add virtual destructor. diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 5a6f619..88ac55f 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1833,7 +1833,7 @@ public: printf_unfiltered ("\n"); } - for (const struct bfd_arch_info *compatible : e->compatible) + for (const bfd_arch_info_type *compatible : e->compatible) printf_unfiltered (" tdesc_add_compatible (result, bfd_scan_arch (\"%s\"));\n", compatible->printable_name);