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

Method copyConstructorShallowCopyError

lib/checkclass.cpp:614–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612 */
613
614void CheckClassImpl::copyConstructorShallowCopyError(const Token *tok, const std::string& varname)
615{
616 reportError(tok, Severity::warning, "copyCtorPointerCopying",
617 "$symbol:" + varname + "\nValue of pointer '$symbol', which points to allocated memory, is copied in copy constructor instead of allocating new memory.", CWE398, Certainty::normal);
618}
619
620static std::string noMemberErrorMessage(const Scope *scope, const char function[], bool isdefault)
621{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected