MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / setValueType

Method setValueType

lib/clangimport.cpp:681–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void clangimport::AstNode::setValueType(Token *tok)
682{
683 for (int i = 0; i < 2; i++) {
684 const std::string &type = getType(i);
685
686 if (type.find('<') != std::string::npos)
687 // TODO
688 continue;
689
690 TokenList decl(mData->mSettings, tok->isCpp() ? Standards::Language::CPP : Standards::Language::C);
691 addTypeTokens(decl, type, tok->scope());
692 if (!decl.front())
693 break;
694
695 ValueType valueType = ValueType::parseDecl(decl.front(), mData->mSettings);
696 if (valueType.type != ValueType::Type::UNKNOWN_TYPE) {
697 tok->setValueType(new ValueType(std::move(valueType)));
698 break;
699 }
700 }
701}
702
703Scope *clangimport::AstNode::createScope(TokenList &tokenList, ScopeType scopeType, AstNodePtr astNode, const Token *def)
704{

Callers 3

varDeclMethod · 0.45
createTokensMethod · 0.45
createTokensCallMethod · 0.45

Calls 3

scopeMethod · 0.80
frontMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected