I have a lot of false positives with CPPCheck 1.90 but not previously for reference parameters saying 'Parameter x can be declared with const' when they can't be. Firstly x is an argument not a parameter so there is an issue with the writing. It should be saying "The parameter of argument x can be declared with const." I use the argument in the initialiser list to initialise a non-const reference member. To initialise one requires another non-const reference.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a lot of false positives with CPPCheck 1.90 but not previously for reference parameters saying 'Parameter x can be declared with const' when they can't be. Firstly x is an argument not a parameter so there is an issue with the writing. It should be saying "The parameter of argument x can be declared with const." I use the argument in the initialiser list to initialise a non-const reference member. To initialise one requires another non-const reference.
These issue maybe related:
https://trac.cppcheck.net/ticket/9330
https://trac.cppcheck.net/ticket/9372
I believe those may have been fixed by this:
https://github.com/danmar/cppcheck/pull/2370
So you could try the latest cppcheck from master to see if this was fixed or not.
Do you mean 1.90 or a later beta? 9372 and 9356 do look like the issue I have.
I mean the version off of the latest master branch on github.