qt.cfg: #9650: Fix missing configuration for QString.chop() (#2556)

chop() and also remove() change the size of a QString, so they have to
be added in the container configuration accordingly to avoid false
positives.
This commit is contained in:
Sebastian 2020-02-26 10:53:03 +01:00 committed by GitHub
parent fb36889d29
commit 8fd17546ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -4969,6 +4969,8 @@
<function name="shrink_to_fit" action="change-internal"/>
<function name="squeeze" action="change-internal"/>
<function name="reserve" action="change-internal"/>
<function name="chop" action="change"/>
<function name="remove" action="change"/>
</size>
<access indexOperator="array-like">
<function name="at" yields="at_index"/>

View File

@ -379,7 +379,7 @@ void MacroTest2_test()
#endif
}
void validCode(int * pIntPtr)
void validCode(int * pIntPtr, QString & qstrArg)
{
if (QFile::exists("test")) {
}
@ -404,6 +404,19 @@ void validCode(int * pIntPtr)
Q_DECLARE_LOGGING_CATEGORY(logging_category_test);
QT_FORWARD_DECLARE_CLASS(forwardDeclaredClass);
QT_FORWARD_DECLARE_STRUCT(forwardDeclaredStruct);
//#9650
QString qstr1(qstrArg);
if (qstr1.length() == 1) {
} else {
qstr1.chop(1);
if (qstr1.length() == 1) {}
}
if (qstr1.length() == 1) {
} else {
qstr1.remove(1);
if (qstr1.length() == 1) {}
}
}
void ignoredReturnValue()