Apparently, cppcheck only looks for duplicate member names within the the immediate base class. Maybe a larger hierarchy could also be supported?
structBase {
inti{};
};structDerived : publicBase {
intj{}; // rename to i to get warnings about both Derived and Derived2
};structDerived2 : publicDerived {
inti{}; //no warning here
};intmain() {
Derived2d2;returnd2.i;
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Apparently, cppcheck only looks for duplicate member names within the the immediate base class. Maybe a larger hierarchy could also be supported?
Thanks! I have created ticket https://trac.cppcheck.net/ticket/9957
I have the feeling this is relatively simple to fix. Please feel free to investigate..