Open rsjaffe opened 4 years ago
Those lines in vector.hpp are operating on a vector<bool>
which is a bit of a special case, since the iterator returns a temporary object which can be used to manipulate the vector. We could however use a "universal reference" (i.e., &&
) which would not collapse to an l-value reference and probably make the analyzer happy. It won't change the behavior here, however.
For the other one, see if making the assignment operator private satisfies the analysis.
I turned on a static analyzer I use (PVS-Studio) and checked the portions of cereal that are used by my applications. There were a couple of alerts on rapidxml and xml—since I believe those are external to your project I'm not listing them here.
The following alerts seem to be significant:
vector.hpp lines 103-108. The assignment
v = b
looks like it doesn't do anything:This was triggered by line 67 of static_object.hpp (
class CEREAL_DLL_EXPORT StaticObject
).