From 979ca9cc9e674d046d377fc1584ce279582af491 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 30 May 2019 00:57:11 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20go/90669=20(go/gofrontend/types.cc:280?= =?utf8?q?5=20contains=20range-based=20=E2=80=98for=E2=80=99=20loops=20whi?= =?utf8?q?ch=20are=20not=20C++98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PR go/90669 compiler: remove range-based 'for' loop Fix for GCC PR/90669: remove range-based 'for' loop to preserve buildability with g++ version 4.X. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179397 From-SVN: r271761 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/types.cc | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index ba9550787af..6a291b5402a 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -3995d545f1e112c682753f342eaef0877551a649 +84b8000c32f671c6cc89df1290ed6e0170308644 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index f6c104cef8a..1b96dc1a4d8 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -2802,8 +2802,13 @@ Ptrmask::symname() const // Redirect the bits vector to the digest, and update the prefix. prefix = "X"; - for (char c : digest) - shabits.push_back((unsigned char) c); + for (std::string::const_iterator p = digest.begin(); + p != digest.end(); + ++p) + { + unsigned char c = *p; + shabits.push_back(c); + } bits = &shabits; } -- 2.30.2