]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix test for old string ABI
authorJonathan Wakely <jwakely@redhat.com>
Thu, 30 Jul 2020 15:04:59 +0000 (16:04 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 30 Jul 2020 15:04:59 +0000 (16:04 +0100)
The COW string doesn't accept const_iterator arguments in insert and
related member functions. Pass a mutable iterator instead.

libstdc++-v3/ChangeLog:

* testsuite/20_util/from_chars/4.cc: Pass non-const iterator
to string::insert.

libstdc++-v3/testsuite/20_util/from_chars/4.cc

index 23fc990bb382cf951f392e56f9b53d60d5560342..8148560be48a6c08f039dc838965cf42e04de51b 100644 (file)
@@ -338,7 +338,7 @@ test_max_mantissa()
        VERIFY( flt == val );
 
        std::string s2 = s.substr(0, len - 5);
-       s2.insert(s2.cbegin() + orig_len - 1, '.');
+       s2.insert(s2.begin() + orig_len - 1, '.');
        s2 += "e000000000001";
        res = std::from_chars(s.data(), s.data() + len, flt, fmt);
        VERIFY( res.ec == std::errc{} );