From 6f8799023f95e02597b9bc2ec3e7aa63bdef98f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 25 Jan 2020 17:22:22 +0100 Subject: [PATCH] Clang import; Clang 9 fix --- lib/clangimport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 318df2cd5..05ee1bc00 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -35,6 +35,7 @@ static const std::string CharacterLiteral = "CharacterLiteral"; static const std::string ClassTemplateDecl = "ClassTemplateDecl"; static const std::string ClassTemplateSpecializationDecl = "ClassTemplateSpecializationDecl"; static const std::string ConditionalOperator = "ConditionalOperator"; +static const std::string ConstantExpr = "ConstantExpr"; static const std::string CompoundAssignOperator = "CompoundAssignOperator"; static const std::string CompoundStmt = "CompoundStmt"; static const std::string ContinueStmt = "ContinueStmt"; @@ -535,7 +536,7 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList) addtoken(tokenList, "case"); children[0]->createTokens(tokenList); addtoken(tokenList, ":"); - children[2]->createTokens(tokenList); + children.back()->createTokens(tokenList); return nullptr; } if (nodeType == ClassTemplateDecl) { @@ -577,6 +578,8 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList) } return nullptr; } + if (nodeType == ConstantExpr) + return children[0]->createTokens(tokenList); if (nodeType == ContinueStmt) return addtoken(tokenList, "continue"); if (nodeType == CStyleCastExpr) {