@@ -1140,12 +1140,13 @@ void clangimport::AstNode::createTokensFunctionDecl(TokenList *tokenList)
11401140 if (tokenList->back () != par1)
11411141 addtoken (tokenList, " ," );
11421142 addTypeTokens (tokenList, child->mExtTokens .back ());
1143+ const Token *typeEndToken = tokenList->back ();
11431144 const std::string spelling = child->getSpelling ();
11441145 Token *vartok = nullptr ;
11451146 if (!spelling.empty ())
11461147 vartok = child->addtoken (tokenList, spelling);
11471148 if (!prev) {
1148- function->argumentList .push_back (Variable (vartok, child->getType (), nullptr , i, AccessControl::Argument, nullptr , scope));
1149+ function->argumentList .push_back (Variable (vartok, child->getType (), nullptr , typeEndToken, i, AccessControl::Argument, nullptr , scope));
11491150 if (vartok) {
11501151 const std::string addr = child->mExtTokens [0 ];
11511152 mData ->varDecl (addr, vartok, &function->argumentList .back ());
@@ -1235,7 +1236,7 @@ Token * clangimport::AstNode::createTokensVarDecl(TokenList *tokenList)
12351236 }
12361237 Token *vartok1 = addtoken (tokenList, name);
12371238 Scope *scope = const_cast <Scope *>(tokenList->back ()->scope ());
1238- scope->varlist .push_back (Variable (vartok1, type, startToken, 0 , scope->defaultAccess (), nullptr , scope));
1239+ scope->varlist .push_back (Variable (vartok1, type, startToken, vartok1-> previous (), 0 , scope->defaultAccess (), nullptr , scope));
12391240 mData ->varDecl (addr, vartok1, &scope->varlist .back ());
12401241 if (mExtTokens .back () == " cinit" && !children.empty ()) {
12411242 Token *eq = addtoken (tokenList, " =" );
0 commit comments