From cde757bcd3092c956356e98f3b5dd4dfed0f8d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 11 Jan 2020 18:39:59 +0100 Subject: [PATCH] Clang import; Type fixes --- lib/clangimport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 046fe0051..49a3413ae 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -144,7 +144,8 @@ namespace clangimport { mDeclMap.insert(std::pair(addr, decl)); def->varId(++mVarId); def->variable(var); - var->setValueType(*def->valueType()); + if (def->valueType()) + var->setValueType(*def->valueType()); notFound(addr); } @@ -386,6 +387,8 @@ void clangimport::AstNode::setValueType(Token *tok) TokenList decl(nullptr); addTypeTokens(&decl, type); + if (!decl.front()) + return; ValueType valueType = ValueType::parseDecl(decl.front(), mData->mSettings); if (valueType.type != ValueType::Type::UNKNOWN_TYPE)