style: Parameter 'client' can be declared as pointer to const [constParameterPointer]
Expected:
No warning. The suggestion is invalid: the map stores Client*, not const Client*. For QMap::insert(const Key&, const T&), substituting T = Client* makes the second parameter Client* const&. It does not permit a pointer to a const client. The stored clients are subsequently used for non-const calls.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Minimal reproduction:
Save as
repro.cpp, then run:Actual:
Expected:
No warning. The suggestion is invalid: the map stores
Client*, notconst Client*. ForQMap::insert(const Key&, const T&), substitutingT = Client*makes the second parameterClient* const&. It does not permit a pointer to a const client. The stored clients are subsequently used for non-const calls.Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/15185