[gcc/devel/c++-modules] libstdc++: Fix test for old string ABI

Nathan Sidwell nathan@gcc.gnu.org
Mon Aug 3 15:25:15 GMT 2020


https://gcc.gnu.org/g:561a19c3011f7bde3a41f2a27ea979118e3a2dff

commit 561a19c3011f7bde3a41f2a27ea979118e3a2dff
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 30 16:04:59 2020 +0100

    libstdc++: Fix test for old string ABI
    
    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.

Diff:
---
 libstdc++-v3/testsuite/20_util/from_chars/4.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/20_util/from_chars/4.cc b/libstdc++-v3/testsuite/20_util/from_chars/4.cc
index 23fc990bb38..8148560be48 100644
--- a/libstdc++-v3/testsuite/20_util/from_chars/4.cc
+++ b/libstdc++-v3/testsuite/20_util/from_chars/4.cc
@@ -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{} );


More information about the Libstdc++-cvs mailing list