Fix #10682 Unused QString / #10686 unused std::array / #10005 unused variable with c++11 braced initializer not detected#3684
Conversation
|
As mentioned in the ticket I assumed other containers might also be affected. And #include <map>
#include <list>
#include <array>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <forward_list>
#include <unordered_set>
#include <unordered_map>
#include <QMap>
#include <QList>
#include <QVector>
#include <QSet>
#include <QMultiMap>
#include <QQueue>
extern void f()
{
std::map<int, int> m;
QMap<int, int> qm;
std::list<int> l;
QList<int> ql;
std::array<int, 1> a;
std::vector<int> v;
QVector<int> qv;
std::set<int> s;
QSet<int> qs;
std::multimap<int, int> mm;
QMultiMap<int, int> qmm;
std::multiset<int> ms;
std::queue<int> q;
QQueue<int> qq;
std::deque<int> d;
std::forward_list<int> fl;
std::unordered_set<int> us;
std::unordered_map<int, int> um;
}
|
| for (const QString &tag: tags) { | ||
| xmlWriter.writeStartElement(CppcheckXml::TagWarningsElementName); | ||
| xmlWriter.writeAttribute(CppcheckXml::TagAttributeName, tag); | ||
| QStringList warnings; |
|
It seems that those containers are missing from |
Ah - I didn't check that. I will add a ticket for that. |
|
Nice. 😀 Better change the title so we know there's two tickets in this PR. |
|
https://trac.cppcheck.net/ticket/10005 is the ticket for the undetected unused braced initializer variables. This is becoming a grand slam.🥳 |
|
Here's some similar tickets you might also want to have a look at after this: |
It never ends, does it? 🤪 |
With these changes we're a lot closer. 🐱👤 And this should probably end here. There's also the side effect shortcomings 😏 But "might" and "after this"! |
It never ends, that's true, I found other cases: |
|
No description provided.