Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12661 FP constParameterPointer with Qt containers #6438

Merged
merged 6 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<define name="SLOT(X)" value="#X"/>
<!-- T qAbs(const T &t) -->
<function name="qAbs">
<pure/>
<noreturn>false</noreturn>
<use-retval/>
<arg nr="1" direction="in">
Expand Down Expand Up @@ -101,6 +102,7 @@
<!-- quint32 qFloatDistance(float a, float b) -->
<!-- quint64 qFloatDistance(double a, double b) -->
<function name="qFloatDistance">
<pure/>
<noreturn>false</noreturn>
<use-retval/>
<leak-ignore/>
Expand Down Expand Up @@ -132,6 +134,7 @@
<!-- bool qFuzzyCompare(double p1, double p2) -->
<!-- bool qFuzzyCompare(float p1, float p2) -->
<function name="qFuzzyCompare">
<pure/>
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
Expand All @@ -147,6 +150,7 @@
<!-- bool qFuzzyIsNull(double d) -->
<!-- bool qFuzzyIsNull(float f) -->
<function name="qFuzzyIsNull">
<pure/>
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
Expand Down Expand Up @@ -177,6 +181,7 @@
<!-- bool qIsFinite(double d) -->
<!-- bool qIsFinite(float f) -->
<function name="qIsFinite">
<pure/>
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
Expand All @@ -189,6 +194,7 @@
<!-- bool qIsInf(double d) -->
<!-- bool qIsInf(float f) -->
<function name="qIsInf">
<pure/>
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
Expand All @@ -201,6 +207,7 @@
<!-- bool qIsNaN(double d) -->
<!-- bool qIsNaN(float f) -->
<function name="qIsNaN">
<pure/>
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
Expand Down Expand Up @@ -267,6 +274,7 @@
<!-- int qRound(double d) -->
<!-- int qRound(float d) -->
<function name="qRound">
<pure/>
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
Expand All @@ -278,6 +286,7 @@
<!-- qint64 qRound64(double d) -->
<!-- qint64 qRound64(float d) -->
<function name="qRound64">
<pure/>
<noreturn>false</noreturn>
<returnValue type="qint64"/>
<use-retval/>
Expand Down Expand Up @@ -780,7 +789,7 @@
<function name="QList::append,QStringList::append">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -1604,7 +1613,7 @@
<function name="QList::prepend,QStringList::prepend">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -1628,7 +1637,7 @@
<function name="QList::push_back,QStringList::push_back">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -1646,7 +1655,7 @@
<function name="QList::push_front,QStringList::push_front">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -1709,7 +1718,7 @@
<function name="QList::removeAll,QStringList::removeAll">
<noreturn>false</noreturn>
<returnValue type="int"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -2599,7 +2608,7 @@
<function name="QBoxLayout::addWidget,QVBoxLayout::addWidget,QHBoxLayout::addWidget">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
<arg nr="2" default="0" direction="in">
Expand Down Expand Up @@ -4185,7 +4194,7 @@
<noreturn>false</noreturn>
<returnValue type="void"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4207,7 +4216,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4229,14 +4238,14 @@
<returnValue type="bool"/>
<use-retval/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
<!-- QVector<T> &QVector::fill(const T &value, int size = ...) -->
<function name="QVector::fill,QStack::fill">
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
<arg nr="2" direction="in" default="-1">
Expand All @@ -4251,7 +4260,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
<arg nr="2" direction="in" default="">
Expand All @@ -4264,13 +4273,13 @@
<function name="QVector::insert,QStack::insert">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<arg nr="3" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4281,7 +4290,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
<arg nr="2" direction="in" default="-1">
Expand All @@ -4295,7 +4304,7 @@
<noreturn>false</noreturn>
<returnValue type="void"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4317,7 +4326,7 @@
<function name="QVector::removeAll,QStack::removeAll">
<noreturn>false</noreturn>
<returnValue type="int"/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4337,7 +4346,7 @@
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<arg nr="2" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -4376,7 +4385,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -4437,7 +4446,7 @@
<noreturn>false</noreturn>
<returnValue type="void"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4448,7 +4457,7 @@
<returnValue type="int"/>
<use-retval/>
<const/>
<arg nr="1" direction="in" default="">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand All @@ -4459,7 +4468,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down Expand Up @@ -4488,7 +4497,7 @@
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" direction="in">
<arg nr="1" direction="in" indirect="0">
<not-uninit/>
</arg>
</function>
Expand Down
5 changes: 5 additions & 0 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,3 +785,8 @@ void unreadVariable_QMapIterator(QMap<QString, QObject*>& m)
it.value() = new QObject();
}
}

void constVariablePointer_QVector(QVector<int*>& qv, int* p)
{
qv.push_back(p); // #12661
}
Loading