From 5b2dacb4b4d56ffa18615863b389a14c6415b816 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Sat, 12 Dec 2015 16:08:52 +0100 Subject: [PATCH] Correct travis and compiler warnings and comments --- lib/tokenlist.cpp | 7 +------ lib/tokenlist.h | 9 ++------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index f55a26ba6..6dad8a6e0 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -1075,18 +1075,13 @@ void TokenList::validateAst() // check for endless recursion const Token* parent=tok; - while (parent = parent->astParent()) { + while ((parent = parent->astParent())) { if (parent==tok) 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 { return _files.at(tok->fileIndex()); diff --git a/lib/tokenlist.h b/lib/tokenlist.h index c6830e2fc..9f7fa0dd5 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -132,18 +132,13 @@ public: void createAst(); /** - * Create abstract syntax tree. + * Check abstract syntax tree. + * Throws InternalError on failure */ void validateAst(); 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 */ TokenList(const TokenList &);