P.S.: I've copy-pasted this quickly, maybe in this reduced example cppcheck won't detect the member functions as virtual, but the problem should be clear anyway.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
due to the latest commits some FPs of this kind show up:
Code:
Output:
Could you please check?
Thanks,
Martin
P.S.: I've copy-pasted this quickly, maybe in this reduced example cppcheck won't detect the member functions as virtual, but the problem should be clear anyway.
This code reproduces the problem, but is only acepted by gcc with
-fpermissive
:There is no warning for standard-compliant
s.pf = &B::f;
.https://github.com/danmar/cppcheck/pull/3913 has been merged, does this fix your problem?