| 1155 | } |
| 1156 | |
| 1157 | void CheckClassImpl::noConstructorError(const Token *tok, const std::string &classname, bool isStruct) |
| 1158 | { |
| 1159 | // For performance reasons the constructor might be intentionally missing. Therefore this is not a "warning" |
| 1160 | const std::string message {"The " + std::string(isStruct ? "struct" : "class") + " '$symbol' does not declare a constructor although it has private member variables which likely require initialization."}; |
| 1161 | const std::string verbose {message + " Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior."}; |
| 1162 | reportError(tok, Severity::style, "noConstructor", "$symbol:" + classname + '\n' + message + '\n' + verbose, CWE398, Certainty::normal); |
| 1163 | } |
| 1164 | |
| 1165 | void CheckClassImpl::noExplicitConstructorError(const Token *tok, const std::string &classname, bool isStruct) |
| 1166 | { |
no test coverage detected