In the following code, I receive this error
bug_cache.cpp:11:14: warning: Member variable 'CacheDF::values_' is not initialized in the constructor. [uninitMemberVar]
explicit CacheDF(double * df) : df_(df) {}
#include <map> #include <set> //----------------------------------------------------------------------------- class CacheDF { public: //using Values = std::set<double>; using Values = std::map<int,double>; explicit CacheDF(double * df) : df_(df) {} private: double * df_{nullptr}; Values * values_{nullptr}; };
But if I replace std::map with std::set, the error goes away.
Regards,
Is this still in moderation?
This reproduces with v2.3. I have created a ticket here: https://trac.cppcheck.net/ticket/10142
This reproduces with v2.3.
I hope you test with latest main also.
Yes, it still reproduces.
Log in to post a comment.
In the following code, I receive this error
bug_cache.cpp:11:14: warning: Member variable 'CacheDF::values_' is not initialized in the constructor. [uninitMemberVar]
But if I replace std::map with std::set, the error goes away.
Regards,
Last edit: Daniel Marjamäki 2021-01-28
Is this still in moderation?
This reproduces with v2.3. I have created a ticket here: https://trac.cppcheck.net/ticket/10142
I hope you test with latest main also.
Yes, it still reproduces.