diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-02-27 15:13:16 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-02-27 15:13:16 +0000 |
commit | f32a3662cda0492c7d18f32e9a8eac1054e69d62 (patch) | |
tree | 06ec9b77e6f4687614077c659519286b10bf1891 | |
parent | da5f369df6dc500183737e251eb19d91f899b92d (diff) | |
download | gcc-f32a3662cda0492c7d18f32e9a8eac1054e69d62.zip gcc-f32a3662cda0492c7d18f32e9a8eac1054e69d62.tar.gz gcc-f32a3662cda0492c7d18f32e9a8eac1054e69d62.tar.bz2 |
libstdc++: Fix std::string error in Debug Mode
This fixes a test failure with -std=gnu++98 -D_GLIBCXX_DEBUG:
FAIL: 21_strings/basic_string/modifiers/insert/char/1.cc (test for excess errors)
* include/debug/string (__gnu_debug::basic_string::insert): Fix for
C++98 where the member function of the base class returns void.
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/string | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 946459c..53fc59c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2020-02-27 Jonathan Wakely <jwakely@redhat.com> + * include/debug/string (__gnu_debug::basic_string::insert): Fix for + C++98 where the member function of the base class returns void. + * testsuite/util/testsuite_iterators.h (forward_iterator_wrapper): Add equality comparisons that support value-initialized iterators. diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 6615b08..1431eba 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -635,7 +635,7 @@ namespace __gnu_debug __glibcxx_check_insert_range(__p, __first, __last, __dist); typename _Base::iterator __res; -#if _GLIBCXX_USE_CXX11_ABI +#if _GLIBCXX_USE_CXX11_ABI && __cplusplus >= 201103 if (__dist.second >= __dp_sign) __res = _Base::insert(__p.base(), __gnu_debug::__unsafe(__first), __gnu_debug::__unsafe(__last)); |