MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / missingMemberCopyError

Method missingMemberCopyError

lib/checkclass.cpp:1200–1208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1198}
1199
1200void CheckClassImpl::missingMemberCopyError(const Token *tok, FunctionType functionType, const std::string& classname, const std::string& varname)
1201{
1202 const std::string ctor(functionType == FunctionType::eCopyConstructor ? "copy" : "move");
1203 const std::string action(functionType == FunctionType::eCopyConstructor ? "copied?" : "moved?");
1204 const std::string message =
1205 "$symbol:" + classname + "::" + varname + "\n" +
1206 "Member variable '$symbol' is not assigned in the " + ctor + " constructor. Should it be " + action;
1207 reportError(tok, Severity::warning, "missingMemberCopy", message, CWE398, Certainty::inconclusive);
1208}
1209
1210void CheckClassImpl::operatorEqVarError(const Token *tok, const std::string &classname, const std::string &varname, bool inconclusive)
1211{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected