From cb9efcb100c3f1dbbf25552559b3813d767900ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 29 Dec 2020 21:36:50 +0100 Subject: [PATCH] Clang import; Add a validation step --- lib/clangimport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index bf8165c71..efed32f82 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -1523,6 +1523,12 @@ void clangimport::parseClangAstDump(Tokenizer *tokenizer, std::istream &f) if (!tree.empty()) tree[0]->createTokens1(tokenList); + // Validation + for (const Token *tok = tokenList->front(); tok; tok = tok->next()) { + if (Token::Match(tok, "(|)|[|]|{|}") && !tok->link()) + throw InternalError(tok, "Token::link() is not set properly"); + } + symbolDatabase->clangSetVariables(data.getVariableList()); tokenList->clangSetOrigFiles(); setTypes(tokenList);