diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-12-02 12:24:41 +0100 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-12-03 06:51:14 +0100 |
| commit | 427da064144a63cebb8f4ad0f053f96c9aceacd8 (patch) | |
| tree | efea77c04db8dde9d088e939ec90cc742b1dea2e /src/tools/uic/cpp/cppwriteinitialization.cpp | |
| parent | 1ebccf3426ef407d174fd9cdfd22da742111331e (diff) | |
QRE: discourage users from assuming that QRE stores the subject
When matching over a QString we store a (shallow) copy of it.
That has always been an implementation detail and people should've
never relied on it, but Hyrum's law, we don't want to actually
exploit this by NOT taking the copy.
Converesely, matching over QStringView already requires that
the string data is kept alive as long as QRE(Match) objects
are alive.
Add a doc note to give us the freedom to do the change in Qt 7.
[ChangeLog][QtCore][QRegularExpression] QRegularExpression takes
a shallow copy of a QString subject when matching over it. This
means that users can destroy or modify the string data while
still having match results over it. This behavior is deprecated;
in a future version of Qt, QRegularExpression will no longer
take a copy. Note that behavior has always been undocumented and
users were never supposed to modify a subject string while
match objects were alive on it. In practice, it's very unlikely
that your code is relying on the existing behavior.
Change-Id: Ibc5f900c09a007139fb12fc4d7f11e4a8f31bf38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
0 files changed, 0 insertions, 0 deletions
