| 3090 | } |
| 3091 | |
| 3092 | void CheckClassImpl::pureVirtualFunctionCallInConstructorError( |
| 3093 | const Function * scopeFunction, |
| 3094 | const std::list<const Token *> & tokStack, |
| 3095 | const std::string &purefuncname) |
| 3096 | { |
| 3097 | const char * scopeFunctionTypeName = scopeFunction ? getFunctionTypeName(scopeFunction->type) : "constructor"; |
| 3098 | |
| 3099 | ErrorPath errorPath; |
| 3100 | std::transform(tokStack.cbegin(), tokStack.cend(), std::back_inserter(errorPath), [](const Token* tok) { |
| 3101 | return ErrorPathItem(tok, "Calling " + tok->str()); |
| 3102 | }); |
| 3103 | if (!errorPath.empty()) |
| 3104 | errorPath.back().second = purefuncname + " is a pure virtual function without body"; |
| 3105 | |
| 3106 | reportError(std::move(errorPath), Severity::warning, "pureVirtualCall", |
| 3107 | "$symbol:" + purefuncname +"\n" |
| 3108 | "Call of pure virtual function '$symbol' in " + scopeFunctionTypeName + ".\n" |
| 3109 | "Call of pure virtual function '$symbol' in " + scopeFunctionTypeName + ". The call will fail during runtime.", CWE(0U), Certainty::normal); |
| 3110 | } |
| 3111 | |
| 3112 | |
| 3113 | //--------------------------------------------------------------------------- |
no test coverage detected