]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Improve exception messages in conversion classes
authorJonathan Wakely <jwakely@redhat.com>
Fri, 8 Nov 2024 11:09:47 +0000 (11:09 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 11 Nov 2024 18:57:16 +0000 (18:57 +0000)
The std::logic_error exceptions thrown from misuses of
std::wbuffer_convert and std::wstring_convert should use names qualified
with "std::".

libstdc++-v3/ChangeLog:

* include/bits/locale_conv.h (wstring_convert, wbuffer_convert):
Adjust strings passed to exception constructors.

libstdc++-v3/include/bits/locale_conv.h

index 63dee1ac8727b9e06b7bf89a90ccb283eaf62ef8..fa328ee2894905e10c10aa9a081b361466ebb9a0 100644 (file)
@@ -289,7 +289,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
        * The object's conversion state will persist between conversions.
        */
       wstring_convert(_Codecvt* __pcvt, state_type __state)
-      : _M_cvt(__pcvt, "wstring_convert"),
+      : _M_cvt(__pcvt, "std::wstring_convert"),
        _M_state(__state), _M_with_cvtstate(true)
       { }
 
@@ -428,7 +428,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
       explicit
       wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt = new _Codecvt,
                      state_type __state = state_type())
-      : _M_buf(__bytebuf), _M_cvt(__pcvt, "wbuffer_convert"),
+      : _M_buf(__bytebuf), _M_cvt(__pcvt, "std::wbuffer_convert"),
        _M_state(__state), _M_always_noconv(_M_cvt->always_noconv())
       {
        if (_M_buf)