MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / typeToString

Function typeToString

lib/errortypes.cpp:23–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "utils.h"
22
23static std::string typeToString(InternalError::Type type)
24{
25 switch (type) {
26 case InternalError::Type::AST:
27 return "internalAstError";
28 case InternalError::Type::SYNTAX:
29 return "syntaxError";
30 case InternalError::Type::UNKNOWN_MACRO:
31 return "unknownMacro";
32 case InternalError::Type::INTERNAL:
33 return "internalError";
34 case InternalError::Type::LIMIT:
35 return "cppcheckLimit";
36 case InternalError::Type::INSTANTIATION:
37 return "instantiationError";
38 }
39 cppcheck::unreachable();
40}
41
42InternalError::InternalError(const Token *tok, std::string errorMsg, Type type) :
43 InternalError(tok, std::move(errorMsg), "", type)

Callers 1

InternalErrorMethod · 0.85

Calls 1

unreachableFunction · 0.85

Tested by

no test coverage detected