Skip to content

Commit cb9efcb

Browse files
committed
Clang import; Add a validation step
1 parent 0adf09c commit cb9efcb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/clangimport.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,12 @@ void clangimport::parseClangAstDump(Tokenizer *tokenizer, std::istream &f)
15231523
if (!tree.empty())
15241524
tree[0]->createTokens1(tokenList);
15251525

1526+
// Validation
1527+
for (const Token *tok = tokenList->front(); tok; tok = tok->next()) {
1528+
if (Token::Match(tok, "(|)|[|]|{|}") && !tok->link())
1529+
throw InternalError(tok, "Token::link() is not set properly");
1530+
}
1531+
15261532
symbolDatabase->clangSetVariables(data.getVariableList());
15271533
tokenList->clangSetOrigFiles();
15281534
setTypes(tokenList);

0 commit comments

Comments
 (0)