qt5base-lts/tests/auto/corelib/text
Giuseppe D'Angelo e540d4a864 QRegularExpression: introduce (global)matchView
QRegularExpression::match (and globalMatch) is currently overloaded
for QString and QStringView. This creates a subtle API asymmetry:

  QRegularExpression re;

  auto m1 = re.match(getQString());       // OK
  auto m2 = re.match(getStdU16String());  // Dangling

This goes against our decision that every time that there's a possible
lifetime issue at play, it should be "evident". Solving the lifetime
issue here is possible, but tricky -- since QRegularExpression
is out-of-line, one needs a type-erased container for the input
string (basically, std::any) to keep it alive and so on.

Instead I went for the simpler solution: deprecate match(QStringView)
and introduce matchView(QStringView) (same for globalMatch). This
makes it clear that the call is matching over a view and therefore
users are supposed to keep the source object alive.

Drive-by, remove the documentation that says that the QString
overloads might not keep the string alive: they do and forever will.

[ChangeLog][QtCore][QRegularExpression] Added the matchView()
and globalMatchView() functions that operate on string views.
The match(QStringView) and globalMatch(QStringView) overloads
have been deprecated.

Change-Id: I054b8605c2fdea59b556dcfea8920ef4eee78ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-29 23:04:27 +02:00
..
qanystringview tst_QAnyStringView: explicitly check the spaceship operator 2022-06-14 01:30:48 +00:00
qbytearray CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qbytearrayapisymmetry Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qbytearraylist Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qbytearraymatcher Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qbytearrayview Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qbytedatabuffer CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qchar CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qcollator CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qlatin1stringview Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qlocale CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qregularexpression QRegularExpression: introduce (global)matchView 2022-07-29 23:04:27 +02:00
qstring CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qstring_no_cast_from_bytearray Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstringapisymmetry CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qstringbuilder Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstringconverter CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qstringiterator CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
qstringlist Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstringmatcher Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstringtokenizer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstringview Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtextboundaryfinder tst_qtextboundaryfinder: Remove full copies of data files 2022-05-24 23:07:43 +02:00
qunicodetools CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:46:53 +02:00
shared Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Android: Enable building of the QLocale test case 2022-05-23 19:12:06 +00:00