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

Method misusedScopeObjectError

lib/checkother.cpp:2619–2627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2617}
2618
2619void CheckOtherImpl::misusedScopeObjectError(const Token *tok, const std::string& varname, bool isAssignment)
2620{
2621 std::string msg = "Instance of '$symbol' object is destroyed immediately";
2622 msg += isAssignment ? ", assignment has no effect." : ".";
2623 reportError(tok, Severity::style,
2624 "unusedScopedObject",
2625 "$symbol:" + varname + "\n" +
2626 msg, CWE563, Certainty::normal);
2627}
2628
2629static const Token * getSingleExpressionInBlock(const Token * tok)
2630{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected