qt5base-lts/tests/auto
Marc Mutz 7180236063 QStringView: improve manual overload management
We want to prevent

  QStringView(QChar|QLatin1String|QByteArray|const char*)

from compiling as QStringView(QString(...)), so I added = delete'ed
ctors for these types to QStringView. However, that makes QStringView
participate in overload resolution for these types. Even if the
QStringView ctor will always fail to compile, the presence of these
ctors alone makes calls to functions overloaded on QString and
QStringView ambiguous:

   f(QStringView);
   f(QString);
   f(foo);        // ambiguous
   f(QChar('f'))    // ambiguous
   f(QLatin1String(foo)); // ambiguous
   f(QByteArray(foo));    // ambiguous

Fix by making the QString and QStringRef constructors templates
constrained to accept only these two types. This should also help to
move the QStringView definition to before the QString one (as soon as
we get rid of or start to ignore QString::Null), simplifying a lot of
code in qstring.h down the line.

This should also fix MSVC's accepting of two user-defined conversions
which caused static non-compile-tests to fail in the initial
QStringView patch, and which were therefore removed. This patch brings
them back.

Change-Id: I95ac38c0d31cd8c726f7e952017569d32e484413
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-29 12:29:35 +00:00
..
android
bic/data Binary compatibility files for QtBase (5.8.0) 2017-02-14 12:42:20 +00:00
cmake CMake: Create a Qt5::<ModuleName>Private target for each module 2016-12-23 19:24:35 +00:00
compilerwarnings/data
concurrent Adapt to the C++ SIC introduced by P0012: noexcept overloading 2017-02-17 13:57:30 +00:00
corelib QStringView: improve manual overload management 2017-03-29 12:29:35 +00:00
dbus Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00
gui Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
guiapplauncher
installed_cmake
network Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
opengl Add support for OpenGL 3.2+ core profile contexts in QPainter 2017-01-23 11:34:05 +00:00
other Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
printsupport Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
shared Remove workaround for potentially unavailable pasteboard in macOS 2017-03-07 01:04:46 +00:00
sql Use unique table name for the sqlite_enableRegexp test 2017-03-27 09:07:02 +00:00
testlib Properly use the "process" feature 2017-02-27 15:44:46 +00:00
tools Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
widgets Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
xml Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
auto.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00
network-settings.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00