qt5base-lts/tests/auto/corelib/text
Vladimir Belyavsky af8f9a2a6e QStringBuilder: allow to be used with 'auto' keyword
The idea is to store a concatenable in a QStringBuilder object by value
or by reference, depending on how it was originally passed into the
concatenation operator. So if it was passed by r-value, we treat it as
a temporary object and hold it by value (and use move-semantic if
available), otherwise we hold it by reference (as before).

To achieve this we first change concatenation operators '%' and '+'
to take their arguments by universal reference. Next we instantiate
QStringBuilder object with deduced types of the arguments, which will
be a "value type" or a "reference type" according to "universal
reference deduction rules".

Further we use perfect forwarding to pass arguments to QStringBuilder's
constructor. Thus arguments, initially passed by r-value reference
and which are move-constructible, will be "moved" to corresponding
QStringBuilder member variables.

So, to summarize:
1. Arguments passed by l-value reference - stored in QStringBuilder
   object by reference (as before).
2. Temporary objects passed by r-value reference - stored in
   QStringBuilder object by value. If a type is move-constructible
   (QSting, QByteArray, etc), the object will be "moved" accordingly.

Special thanks to Giuseppe D'Angelo for the tests.

Fixes: QTBUG-99291
Fixes: QTBUG-87603
Fixes: QTBUG-47066
Task-number: QTBUG-74873
Task-number: QTBUG-103090
Task-number: QTBUG-104354
Change-Id: I64f417be0de0815ec5ae7e35a1cc6cef6d887933
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-13 20:01:37 +00:00
..
qanystringview tst_QAnyStringView: test some longer strings and some containing nulls 2023-06-13 04:48:05 -07:00
qbytearray QByteArray: add STL-style assign() 2023-06-02 06:43:31 +02:00
qbytearray_large tst_QByteArrayLarge::initTestCase: Skip tests under ASAN 2022-11-30 04:50:37 +01:00
qbytearrayapisymmetry tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearraylist tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearraymatcher tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytearrayview tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qbytedatabuffer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qchar tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qcollator Silence a few unused-but-set-parameter warnings in some of the tests 2023-03-06 17:16:14 +01:00
qlatin1stringmatcher Add Boyer-Moore Latin-1 string searcher with optional case sensitivity 2022-12-08 17:56:47 +01:00
qlatin1stringview QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines 2022-08-24 22:08:49 +02:00
qlocale Fix case-sensitivity of exponent separator check in Cyrillic fall-back 2023-05-15 14:02:47 +02:00
qregularexpression QRegularExpression: match newlines when converting wildcards 2023-05-23 00:03:37 +02:00
qstring QString: add STL-style assign() [3/4]: (it,it) overload for char32_t 2023-06-09 11:50:18 +00:00
qstring_no_cast_from_bytearray tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringapisymmetry tst_qstringapisymmetry: silence a GCC warning 2023-04-08 13:21:24 +02:00
qstringbuilder QStringBuilder: allow to be used with 'auto' keyword 2023-06-13 20:01:37 +00:00
qstringconverter QStringDecoder: add a char16_t overload of appendToBuffer(QChar*, ~~~) 2023-06-04 06:32:59 +00:00
qstringiterator tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringlist tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringmatcher tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringtokenizer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstringview tst_Q(Any)StringView: check conversion from winrt::hstring 2023-03-31 21:41:35 +00:00
qtextboundaryfinder tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qunicodetools Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
shared Provide optTitle for a NumberDoubleTestData testcase that needs it 2022-10-11 11:21:38 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00