diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-11-16 12:40:21 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-12-01 19:29:14 +0000 |
commit | a6b7447058f42e9b592644b85e37b5705e6aa675 (patch) | |
tree | 0abadc440c9a4c2e398ce8a14bbfb788542ef116 /src | |
parent | 4c704fad089ddd92e9d274faa5a840dd96349ca1 (diff) |
Disable some implicit conversions with QT_RESTRICTED_CAST_FROM_ASCII
Non-const arrays are not literals, so their encoding may be
not defined at compile-time and they should be converted
explicitly.
Change-Id: I2a65e095224f48efafeaa97fd85134697a1e5bf0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstring.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index b411bdac5a..af1513442a 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -675,8 +675,12 @@ public: : d(fromAscii_helper(ch, N - 1)) {} template <int N> + QString(char (&)[N]) = delete; + template <int N> inline QString &operator=(const char (&ch)[N]) { return (*this = fromUtf8(ch, N - 1)); } + template <int N> + QString &operator=(char (&)[N]) = delete; #endif #if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) inline QT_ASCII_CAST_WARN QString(const char *ch) |