compiler: remove range-based 'for' loop
Fix for GCC PR/90669: remove range-based 'for' loop to preserve
buildability with g++ version 4.X.
Change-Id: Idf1e2da007b3d68f9ffa824622060ad01d29f0ab
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179397
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/go/types.cc b/go/types.cc
index f6c104c..1b96dc1 100644
--- a/go/types.cc
+++ b/go/types.cc
@@ -2802,8 +2802,13 @@
// 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;
}