diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 333c62edc..407ac5bbe 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5068,9 +5068,10 @@ void Tokenizer::removeExceptionSpecifications(Token *tok) const bool Tokenizer::validate() const { std::stack linktok; - + const Token *lastTok = 0; for (const Token *tok = tokens(); tok; tok = tok->next()) { + lastTok = tok; if (Token::Match(tok, "[{([]")) { if (tok->link() == 0) @@ -5126,6 +5127,15 @@ bool Tokenizer::validate() const return false; } + if (lastTok != _tokensBack) + { + // TODO, the two lines below should be uncommented and + // problems that appear with testrunner should be fixed + + //cppcheckError(lastTok); + //return false; + } + return true; }