Somehow the typedef should be handled better. From the --debug output:
12:Subset<Elt>::Referenceget();
Since the typedefs are simplified it would have been better if that line said Elt& get ( ) ; instead. I have created https://trac.cppcheck.net/ticket/10239 for that.
I will look at the returnsReference also..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi -
This example gives a false positive with cppcheck 2.4.1:
I can fix this with this change. I don't observe any changes to the
make test results.
Thanks! I can reproduce.
Somehow the typedef should be handled better. From the
--debugoutput:Since the typedefs are simplified it would have been better if that line said
Elt& get ( ) ;instead. I have created https://trac.cppcheck.net/ticket/10239 for that.I will look at the returnsReference also..
I made a fix also inspired by your code eacc9e552ebcb0550cbec8f930e5ab72f58285c9