diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index a281cbe42..1ca332852 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -583,11 +583,6 @@ void CheckClass::privateFunctions() if (!_settings->isEnabled("style")) return; - // don't check code that contains templates. Templates that are - // "unused" are removed from the code. #2067 - if (_tokenizer->codeWithTemplates()) - return; - for (std::list::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { // only check classes and structures if (!scope->isClassOrStruct()) diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 161ee9317..cb3e92073 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -33,11 +33,6 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer) { - // if there are templates there might be false positives - templates |= tokenizer.codeWithTemplates(); - if (templates) - return; - // Function declarations.. for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) { if (tok->fileIndex() != 0) @@ -142,9 +137,6 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer) void CheckUnusedFunctions::check(ErrorLogger * const errorLogger) { - if (templates) - return; - for (std::map::const_iterator it = _functions.begin(); it != _functions.end(); ++it) { const FunctionUsage &func = it->second; if (func.usedOtherFile || func.filename.empty()) diff --git a/lib/checkunusedfunctions.h b/lib/checkunusedfunctions.h index dedf7f7e3..835a01cbb 100644 --- a/lib/checkunusedfunctions.h +++ b/lib/checkunusedfunctions.h @@ -33,12 +33,12 @@ class CPPCHECKLIB CheckUnusedFunctions: public Check { public: /** @brief This constructor is used when registering the CheckUnusedFunctions */ - CheckUnusedFunctions() : Check(myName()), templates(false) + CheckUnusedFunctions() : Check(myName()) { } /** @brief This constructor is used when running checks. */ CheckUnusedFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) - : Check(myName(), tokenizer, settings, errorLogger), templates(false) + : Check(myName(), tokenizer, settings, errorLogger) { } // Parse current tokens and determine.. @@ -89,8 +89,6 @@ private: }; std::map _functions; - - bool templates; }; /// @} //---------------------------------------------------------------------------