Группа :: Система/Библиотеки
Пакет: qt5-base
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: kde-5.15-rev-f8ad329f7ee.patch
Скачать
Скачать
commit f8ad329f7ee01993c388f78851fc4ac88f5093b4
Author: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Date: Thu Nov 12 13:22:02 2020 +0100
QCharRef: properly disable assignment from char
Under QT_NO_CAST_FROM_ASCII the assignment would fall back
to operator=(int) after a promotion. Add a deleted overload
to block this. (QChar itself uses a private constructor
for the same purpose, but I chose the C++11 solution).
Nothing to do in Qt 6, QCharRef is gone.
Change-Id: Iba50ad2b6ad95d7c3a5e4920ab03fae5d3db0319
Fixes: QTBUG-88431
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
diff --git b/src/corelib/text/qstring.h a/src/corelib/text/qstring.h
index fe97279aaf..5a4ac497e0 100644
--- b/src/corelib/text/qstring.h
+++ a/src/corelib/text/qstring.h
@@ -1231,10 +1231,6 @@ public:
{ return operator=(QChar::fromLatin1(c)); }
inline QT_ASCII_CAST_WARN QCharRef &operator=(uchar c)
{ return operator=(QChar::fromLatin1(c)); }
-#else
- // prevent char -> int promotion, bypassing QT_NO_CAST_FROM_ASCII
- QCharRef &operator=(char c) = delete;
- QCharRef &operator=(uchar c) = delete;
#endif
inline QCharRef &operator=(const QCharRef &c) { return operator=(QChar(c)); }
inline QCharRef &operator=(ushort rc) { return operator=(QChar(rc)); }