From c5e6f7d57208c04715dbc00b03e4e4a49f145ca6 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 23 Mar 2016 09:39:21 +0100 Subject: Hide mixed comparisons with QT_RESTRICTED_CAST_FROM_ASCII While the implementation of the QByteArray::operatorX(const QString &s2) for X \in { ==, !=, <, <=, >, >=} was already inavailable when QT_RESTRICTED_CAST_FROM_ASCII was defined, the declaration was still visible, leading effectively to a linking error. This change hides the declaration, too, creating a compiler error as intended, and as present with the QString::operatorX(const QByteArray &s2) functions. Change-Id: Ifdb0b85b7423b3b9c69212639b1512b0808a7983 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qbytearray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qbytearray.h') diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index f0032227e8..eb826bae4e 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -327,7 +327,7 @@ public: QT_ASCII_CAST_WARN int indexOf(const QString &s, int from = 0) const; QT_ASCII_CAST_WARN int lastIndexOf(const QString &s, int from = -1) const; #endif -#ifndef QT_NO_CAST_FROM_ASCII +#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) inline QT_ASCII_CAST_WARN bool operator==(const QString &s2) const; inline QT_ASCII_CAST_WARN bool operator!=(const QString &s2) const; inline QT_ASCII_CAST_WARN bool operator<(const QString &s2) const; -- cgit v1.2.3