Correct travis and compiler warnings and comments

This commit is contained in:
Alexander Mai 2015-12-12 16:08:52 +01:00
parent 04f9b71281
commit 5b2dacb4b4
2 changed files with 3 additions and 13 deletions

View File

@ -1075,18 +1075,13 @@ void TokenList::validateAst()
// check for endless recursion // check for endless recursion
const Token* parent=tok; const Token* parent=tok;
while (parent = parent->astParent()) { while ((parent = parent->astParent())) {
if (parent==tok) if (parent==tok)
throw InternalError(tok, "AST broken: endless recursion from '" + tok->str() + "'", InternalError::SYNTAX); throw InternalError(tok, "AST broken: endless recursion from '" + tok->str() + "'", InternalError::SYNTAX);
} }
} }
} }
void TokenList::cppcheckError(const Token *tok) const
{
throw InternalError(tok, "Analysis failed - inconsisten AST. If the code is valid then please report this failure.", InternalError::INTERNAL);
}
const std::string& TokenList::file(const Token *tok) const const std::string& TokenList::file(const Token *tok) const
{ {
return _files.at(tok->fileIndex()); return _files.at(tok->fileIndex());

View File

@ -132,18 +132,13 @@ public:
void createAst(); void createAst();
/** /**
* Create abstract syntax tree. * Check abstract syntax tree.
* Throws InternalError on failure
*/ */
void validateAst(); void validateAst();
private: private:
/**
* Send error message to error logger about internal bug.
* @param tok the token that this bug concerns.
*/
void cppcheckError(const Token *tok) const;
/** Disable copy constructor, no implementation */ /** Disable copy constructor, no implementation */
TokenList(const TokenList &); TokenList(const TokenList &);