Mark syntax error functions as noreturn

This commit is contained in:
Paul 2020-06-29 15:33:25 -05:00
parent 600919f624
commit a412e3e1f1
2 changed files with 4 additions and 5 deletions

View File

@ -3560,7 +3560,6 @@ void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *s
typeTok = typeTok->next();
if (Token::Match(typeTok, ",|)")) { // #8333
symbolDatabase->mTokenizer->syntaxError(typeTok);
return;
}
// skip over qualification
while (Token::Match(typeTok, "%type% ::"))

View File

@ -607,16 +607,16 @@ private:
public:
/** Syntax error */
void syntaxError(const Token *tok, const std::string &code = "") const;
[[noreturn]] void syntaxError(const Token *tok, const std::string &code = "") const;
/** Syntax error. Unmatched character. */
void unmatchedToken(const Token *tok) const;
[[noreturn]] void unmatchedToken(const Token *tok) const;
/** Syntax error. C++ code in C file. */
void syntaxErrorC(const Token *tok, const std::string &what) const;
[[noreturn]] void syntaxErrorC(const Token *tok, const std::string &what) const;
/** Warn about unknown macro(s), configuration is recommended */
void unknownMacroError(const Token *tok1) const;
[[noreturn]] void unknownMacroError(const Token *tok1) const;
private: