diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-10-07 05:30:54 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-10-07 08:18:53 +0200 |
commit | a6ffdbe30c49fa1ede0d147531b89d121d00fa94 (patch) | |
tree | f0a7fc907795055e0a00ba18764ee088fe911220 | |
parent | a2e718a71abad719ea196e9dc4d90d9267102f54 (diff) |
QTextCodec: try to work around an ICC 19 bug
ICC 19 barfs on the TextCodecsMutexLocker class because it doesn't
have a user-provided default ctor:
../../corelib/codecs/qtextcodec.cpp(543): error #854: const variable locker requires an initializer -- class TextCodecsMutexLocker has no user-provided default constructor
[...]
But the class doesn't have members that would delete the
implictly-declared default ctor, so no user-provided default ctor
should be necessary:
The only member is the result of qt_unique_lock(), which is
std::unique_lock, which does have a default ctor.
We conclude that this is a compiler bug, and work around it with the
introduction of a user-provided default ctor.
Fix brace placement as a drive-by.
Fixes: QTBUG-78844
Change-Id: I1f5a326afd68138fbebad506ba9aa1926f1afb85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 14f9abc28a..06fd88da90 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -103,10 +103,13 @@ typedef QList<QByteArray>::ConstIterator ByteArrayListConstIt; Q_GLOBAL_STATIC(QRecursiveMutex, textCodecsMutex); -class TextCodecsMutexLocker { +class TextCodecsMutexLocker +{ using Lock = decltype(qt_unique_lock(std::declval<QRecursiveMutex&>())); // ### FIXME: this is used when textCodecsMutex already == nullptr const Lock lock = qt_unique_lock(textCodecsMutex()); +public: + TextCodecsMutexLocker() {} // required d/t an ICC 19 bug }; #if !QT_CONFIG(icu) |