Skip to content

Commit 9091fd3

Browse files
committed
Do not add type alias templates twice to the AST
This also fixes a memory leak since the copies were never destroyed. Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 2d75735 commit 9091fd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CppParser/Parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,11 +1539,11 @@ TypeAliasTemplate* Parser::WalkTypeAliasTemplate(
15391539
HandleDeclaration(TD, TA);
15401540

15411541
TA->name = GetDeclName(TD);
1542+
NS->Templates.push_back(TA);
1543+
15421544
TA->TemplatedDecl = WalkDeclaration(TD->getTemplatedDecl());
15431545
TA->Parameters = WalkTemplateParameterList(TD->getTemplateParameters());
15441546

1545-
NS->Templates.push_back(TA);
1546-
15471547
return TA;
15481548
}
15491549

0 commit comments

Comments
 (0)