TemplateSimplifier: Set column number for expanded tokens
This commit is contained in:
parent
f33a8a417f
commit
95ac8db584
|
@ -1863,6 +1863,7 @@ void TemplateSimplifier::expandTemplate(
|
||||||
brackets1.pop();
|
brackets1.pop();
|
||||||
}
|
}
|
||||||
back->isTemplateArg(true);
|
back->isTemplateArg(true);
|
||||||
|
back->col(tok5->col());
|
||||||
added = true;
|
added = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1872,6 +1873,7 @@ void TemplateSimplifier::expandTemplate(
|
||||||
if (!added) {
|
if (!added) {
|
||||||
mTokenList.addtoken(tok5, tok5->linenr(), tok5->fileIndex());
|
mTokenList.addtoken(tok5, tok5->linenr(), tok5->fileIndex());
|
||||||
Token *back = mTokenList.back();
|
Token *back = mTokenList.back();
|
||||||
|
back->col(tok5->col());
|
||||||
if (Token::Match(back, "{|(|[")) {
|
if (Token::Match(back, "{|(|[")) {
|
||||||
brackets2.push(back);
|
brackets2.push(back);
|
||||||
} else if (back->str() == "}") {
|
} else if (back->str() == "}") {
|
||||||
|
@ -1949,6 +1951,7 @@ void TemplateSimplifier::expandTemplate(
|
||||||
if (copy) {
|
if (copy) {
|
||||||
mTokenList.addtoken(typetok, tok3->linenr(), tok3->fileIndex());
|
mTokenList.addtoken(typetok, tok3->linenr(), tok3->fileIndex());
|
||||||
Token *back = mTokenList.back();
|
Token *back = mTokenList.back();
|
||||||
|
back->col(tok3->col());
|
||||||
if (Token::Match(back, "{|(|[")) {
|
if (Token::Match(back, "{|(|[")) {
|
||||||
brackets1.push(back);
|
brackets1.push(back);
|
||||||
} else if (back->str() == "(") {
|
} else if (back->str() == "(") {
|
||||||
|
@ -1986,6 +1989,8 @@ void TemplateSimplifier::expandTemplate(
|
||||||
Token::Match(tok3, newName.c_str())) {
|
Token::Match(tok3, newName.c_str())) {
|
||||||
if (copy) {
|
if (copy) {
|
||||||
mTokenList.addtoken(newName, tok3->linenr(), tok3->fileIndex());
|
mTokenList.addtoken(newName, tok3->linenr(), tok3->fileIndex());
|
||||||
|
Token *back = mTokenList.back();
|
||||||
|
back->col(tok3->col());
|
||||||
tok3 = closingBracket;
|
tok3 = closingBracket;
|
||||||
} else {
|
} else {
|
||||||
tok3->str(newName);
|
tok3->str(newName);
|
||||||
|
@ -2007,6 +2012,8 @@ void TemplateSimplifier::expandTemplate(
|
||||||
addNamespace(templateDeclaration, tok3);
|
addNamespace(templateDeclaration, tok3);
|
||||||
}
|
}
|
||||||
mTokenList.addtoken(newName, tok3->linenr(), tok3->fileIndex());
|
mTokenList.addtoken(newName, tok3->linenr(), tok3->fileIndex());
|
||||||
|
Token *back = mTokenList.back();
|
||||||
|
back->col(tok3->col());
|
||||||
} else if (!Token::Match(tok3->next(), ":|{|="))
|
} else if (!Token::Match(tok3->next(), ":|{|="))
|
||||||
tok3->str(newName);
|
tok3->str(newName);
|
||||||
continue;
|
continue;
|
||||||
|
@ -2014,8 +2021,11 @@ void TemplateSimplifier::expandTemplate(
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy
|
// copy
|
||||||
if (copy)
|
if (copy) {
|
||||||
mTokenList.addtoken(tok3, tok3->linenr(), tok3->fileIndex());
|
mTokenList.addtoken(tok3, tok3->linenr(), tok3->fileIndex());
|
||||||
|
Token *back = mTokenList.back();
|
||||||
|
back->col(tok3->col());
|
||||||
|
}
|
||||||
|
|
||||||
if (Token::Match(tok3, "%type% <") &&
|
if (Token::Match(tok3, "%type% <") &&
|
||||||
!Token::Match(tok3, "template|static_cast|const_cast|reinterpret_cast|dynamic_cast") &&
|
!Token::Match(tok3, "template|static_cast|const_cast|reinterpret_cast|dynamic_cast") &&
|
||||||
|
|
Loading…
Reference in New Issue