diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 34ae6f029..f8b36b484 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -32,6 +32,13 @@ class TokenList; /// @addtogroup Core /// @{ +/** @brief Simple container to be thrown when internal error is detected. */ +struct InternalError { + InternalError(const Token *tok, const std::string &errorMsg); + const Token *token; + std::string errorMessage; +}; + /** @brief enum class for severity. Used when reporting errors. */ class CPPCHECKLIB Severity { public: @@ -109,7 +116,7 @@ public: case debug: return "debug"; }; - return "???"; + throw InternalError(NULL, "Unknown severity"); } static SeverityType fromString(const std::string &severity) { if (severity.empty()) @@ -299,13 +306,6 @@ public: static std::string callStackToString(const std::list &callStack); }; -/** @brief Simple container to be thrown when internal error is detected. */ -struct InternalError { - InternalError(const Token *tok, const std::string &errorMsg); - const Token *token; - std::string errorMessage; -}; - /// @} #endif