summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringconverter.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-18 17:19:19 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-02-20 20:57:46 +0100
commitef6c4dfb1c14a55e480cc2c92555da4c93f01daf (patch)
treeecd9a17eb5adc4b6fed51f9dd9b0ee2af3f2da07 /src/corelib/text/qstringconverter.cpp
parent29b18a017968cbc79dfcd21ea1622de823dc1596 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstringconverter.cpp')
-rw-r--r--src/corelib/text/qstringconverter.cpp7
1 files changed, 6 insertions, 1 deletions
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<QStringEncoder>);
+static_assert(std::is_nothrow_move_assignable_v<QStringEncoder>);
+static_assert(std::is_nothrow_move_constructible_v<QStringDecoder>);
+static_assert(std::is_nothrow_move_assignable_v<QStringDecoder>);
+
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);