From ef6c4dfb1c14a55e480cc2c92555da4c93f01daf Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 18 Feb 2022 17:19:19 +0100 Subject: QStringConverter/Encoder/Decoder: make move noexcept The State state data member had non-noexcept move-SMFs, which were inherited by the move-SMFs of QStringConverter, QStringEncoder and QStringDecoder. To fix, because it is called in the move-assignment operator, we need to mark State::clear() as noexcept, and, since that can perform an indirect call through clearFn, require the clearFn to be noexcept, too. The only users of clearFn were in Qt5Compat; a separate fix should have been merged there by the time this lands. Change-Id: Ibe8147970886526b6a479960050e108607b63874 Reviewed-by: Thiago Macieira --- src/corelib/text/qstringconverter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/corelib/text/qstringconverter.cpp') diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index e6c2552348..199e85aaae 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -60,6 +60,11 @@ QT_BEGIN_NAMESPACE +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + enum { Endian = 0, Data = 1 }; static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf }; @@ -1388,7 +1393,7 @@ QByteArray QLocal8Bit::convertFromUnicode(QStringView in, QStringConverter::Stat } #endif -void QStringConverter::State::clear() +void QStringConverter::State::clear() noexcept { if (clearFn) clearFn(this); -- cgit v1.2.3