In the code below, we get correct warnings about Base::noCopyBase and Derived2::noCopy2, and a false positive about Derived2::d2. All three warnings can be suppressed by adding in-class member initializers.
At last, there is a false negative concerning Derived::noCopy. I could understand if cppcheck cannot see a copy operation hidden in a class hierarchy like that, but why does it then emit warnings about Derived2?
I think the hierarchy Base->Derived->Derived2 is needed for the FP.
However, the legitimate warnings about noCopyBase and noCopy2 can still be suppressed by adding initializers in v2.2. This could be a different issue, though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the code below, we get correct warnings about Base::noCopyBase and Derived2::noCopy2, and a false positive about Derived2::d2. All three warnings can be suppressed by adding in-class member initializers.
At last, there is a false negative concerning Derived::noCopy. I could understand if cppcheck cannot see a copy operation hidden in a class hierarchy like that, but why does it then emit warnings about Derived2?
bump
This has actually been extracted from real-world code...
hmm.. is it possible to reduce it. A minimal example that writes a FP.
I think the hierarchy Base->Derived->Derived2 is needed for the FP.
However, the legitimate warnings about noCopyBase and noCopy2 can still be suppressed by adding initializers in v2.2. This could be a different issue, though.