Skip to content

Commit

Permalink
Partial fix for #10689 Several Qt containers are missing from qt.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Mar 18, 2024
1 parent 967323e commit 079997c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
33 changes: 33 additions & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5183,6 +5183,39 @@
<function name="crend" yields="end-iterator"/>
</access>
</container>
<container id="qtMap" startPattern="QMap|QMultiMap &lt;" inherits="qtContainer">
<type templateParameter="1" associative="std-like"/>
<rangeItemRecordType>
<member name="first" templateParameter="0"/>
<member name="second" templateParameter="1"/>
</rangeItemRecordType>
<access>
<function name="count" action="find"/>
<function name="find" action="find" yields="iterator"/>
<function name="insert" action="push"/>
<function name="lower_bound" yields="iterator"/>
<function name="upper_bound" yields="iterator"/>
</access>
</container>
<container id="qtSet" startPattern="QSet &lt;" inherits="qtContainer">
<access>
<function name="count" action="find"/>
<function name="find" action="find" yields="iterator"/>
<function name="insert" action="push"/>
</access>
</container>
<container id="qtQueue" startPattern="QQueue &lt;" inherits="qtContainer">
<access>
<function name="at" yields="at_index"/>
<function name="emplace" action="push" yields="item"/>
<function name="push_front" action="push"/>
<function name="push_back" action="push"/>
<function name="pop_back" action="pop"/>
<function name="pop_front" action="pop"/>
<function name="front" yields="item"/>
<function name="back" yields="item"/>
</access>
</container>
<type-checks>
<unusedvar>
<suppress>QApplication</suppress>
Expand Down
12 changes: 12 additions & 0 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,3 +713,15 @@ bool knownConditionTrueFalse_QString_count(const QString& s) // #11036
return false;
return true;
}

void unusedVariable_qtContainers() // #10689
{
// cppcheck-suppress unusedVariable
QMap<int, int> qm;
// cppcheck-suppress unusedVariable
QSet<int> qs;
// cppcheck-suppress unusedVariable
QMultiMap<int, int> qmm;
// cppcheck-suppress unusedVariable
QQueue<int> qq;
}

0 comments on commit 079997c

Please sign in to comment.