| 3313 | } |
| 3314 | |
| 3315 | void CheckClassImpl::checkOverride() |
| 3316 | { |
| 3317 | if (!mSettings.severity.isEnabled(Severity::style) && !mSettings.isPremiumEnabled("missingOverride")) |
| 3318 | return; |
| 3319 | if (mSettings.standards.cpp < Standards::CPP11) |
| 3320 | return; |
| 3321 | logChecker("CheckClass::checkMissingOverride"); // style,c++03 |
| 3322 | for (const Scope * classScope : mSymbolDatabase->classAndStructScopes) { |
| 3323 | if (!classScope->definedType || classScope->definedType->derivedFrom.empty()) |
| 3324 | continue; |
| 3325 | for (const Function &func : classScope->functionList) { |
| 3326 | if (func.hasOverrideSpecifier() || func.hasFinalSpecifier()) |
| 3327 | continue; |
| 3328 | if (func.tokenDef->isExpandedMacro()) |
| 3329 | continue; |
| 3330 | if (func.templateDef) |
| 3331 | continue; |
| 3332 | const Function *baseFunc = func.getOverriddenFunction(); |
| 3333 | if (baseFunc) |
| 3334 | overrideError(baseFunc, &func); |
| 3335 | } |
| 3336 | } |
| 3337 | } |
| 3338 | |
| 3339 | void CheckClassImpl::overrideError(const Function *funcInBase, const Function *funcInDerived) |
| 3340 | { |
no test coverage detected