aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-09-18 22:35:40 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-09-18 22:35:40 +0000
commitd2b4864f55092b342dae9f2d147939f7ce08dfdc (patch)
treef71c42d01806bac6a3b23bd42b06acbf5461b06c
parent72d4fc12c068f59bc865ac8dc423be07a2794f6b (diff)
parent4d034b52593c40db9ceeaa531eefdb628fa29ce5 (diff)
downloadgcc-d2b4864f55092b342dae9f2d147939f7ce08dfdc.zip
gcc-d2b4864f55092b342dae9f2d147939f7ce08dfdc.tar.gz
gcc-d2b4864f55092b342dae9f2d147939f7ce08dfdc.tar.bz2
Merge from trunk revision 252954.
From-SVN: r252955
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/runtime/go-strslice.c11
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc6
4 files changed, 15 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 4081aa9..27bcb6e 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-abe58fdc529378706d65d6b22e4871646eb9023e
+be69546afcac182cc93c569bc96665f0ef72d66a
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/runtime/go-strslice.c b/libgo/runtime/go-strslice.c
index 0e897812..d51c249 100644
--- a/libgo/runtime/go-strslice.c
+++ b/libgo/runtime/go-strslice.c
@@ -18,10 +18,13 @@ __go_string_slice (String s, intgo start, intgo end)
if (start > len || end < start || end > len)
runtime_panicstring ("string index out of bounds");
ret.len = end - start;
- // If the length of the new string is zero, don't adjust the str
- // field. This ensures that we don't create a pointer to the next
- // memory block, and thus keep it live unnecessarily.
- if (ret.len > 0)
+ // If the length of the new string is zero, the str field doesn't
+ // matter, so just set it to nil. This avoids the problem of
+ // s.str + start pointing just past the end of the string,
+ // which may keep the next memory block alive unnecessarily.
+ if (ret.len == 0)
+ ret.str = nil;
+ else
ret.str = s.str + start;
return ret;
}
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c83f075..28a9609 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2017-09-18 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/81468
+ * testsuite/20_util/duration/cons/dr1177.cc: Fix incorrect test and
+ improve static assertion messages.
+
* include/std/utility (_Itup_cat, _Make_integer_sequence): Remove.
(_Build_index_tuple, make_integer_sequence): Use built-in to generate
pack expansion.
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc b/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc
index 28c881c..d90cd27 100644
--- a/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc
@@ -36,6 +36,6 @@ static_assert(is_constructible<duration<int>, duration<long>>{},
static_assert(!is_constructible<duration<int>, duration<int, ratio<2,3>>>{},
"cannot convert duration to one with different period");
static_assert(is_constructible<duration<float>, duration<int, ratio<2,3>>>{},
- "unless it has a floating-point representation");
-static_assert(is_constructible<duration<float>, duration<int, ratio<1,3>>>{},
- "or a period that is an integral multiple of the original");
+ "... unless the result type has a floating-point representation");
+static_assert(is_constructible<duration<int, ratio<1,3>>, duration<int>>{},
+ "... or the original's period is a multiple of the result's period");