Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/templatesimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ void TemplateSimplifier::simplifyTemplateAliases()
}
tok2 = aliasUsage.token->next(); // the '<'
const Token * const endToken1 = templateAlias.token->next()->findClosingBracket();
const Token * const endToken2 = TokenList::copyTokens(tok2, templateAlias.token->tokAt(2), endToken1->previous(), false);
const Token * const endToken2 = TokenList::copyTokens(tok2, templateAlias.token->tokAt(2), endToken1->previous(), false)->next();
for (const Token *tok1 = templateAlias.token->next(); tok2 != endToken2; tok1 = tok1->next(), tok2 = tok2->next()) {
if (!tok2->isName())
continue;
Expand Down Expand Up @@ -1147,7 +1147,7 @@ void TemplateSimplifier::simplifyTemplateAliases()
endToken = endToken1->next();

// Remove alias usage code (parameters)
Token::eraseTokens(tok2, args.back().second);
Token::eraseTokens(tok2->previous(), args.back().second);
}
if (endToken) {
// Remove all template instantiations in template alias
Expand Down
7 changes: 2 additions & 5 deletions test/testsimplifytemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3397,12 +3397,9 @@ class TestSimplifyTemplate : public TestFixture {
"IntrusivePtr<Vertex<int>> p;";
const char expected[] = "; "
"class Vertex<int> ; "
"boost :: intrusive_ptr < Vertex<int> > p ;"
"boost :: intrusive_ptr < Vertex<int> > p ; "
"class Vertex<int> { } ;";
const char actual[] = "; "
"template < class T > class Vertex { } ; "
"boost :: intrusive_ptr < T > p ;";
TODO_ASSERT_EQUALS(expected, actual, tok(code));
ASSERT_EQUALS(expected, tok(code));
}

unsigned int instantiateMatch(const char code[], const std::size_t numberOfArguments, const char patternAfter[]) {
Expand Down