Fix bug not correctly parsing template expression

This commit is contained in:
2019-04-22 15:41:22 +10:00
parent 98f0402916
commit f0684b4113
3 changed files with 48 additions and 12 deletions
+2 -1
View File
@@ -690,6 +690,7 @@ CPPDeclLinkedList<CPPVariableDecl> *ParseCPPTypeAndVariableDecl(CPPTokeniser *to
Slice<char> variable_template_expr = {};
if (CPPTokeniser_AcceptTokenIfType(tokeniser, CPPTokenType::LessThan, &token))
{
CPPToken template_start_token = token;
int template_depth = 1;
while (template_depth != 0 && token.type != CPPTokenType::EndOfStream)
{
@@ -702,7 +703,7 @@ CPPDeclLinkedList<CPPVariableDecl> *ParseCPPTypeAndVariableDecl(CPPTokeniser *to
if (template_depth == 0)
{
char *expr_start = token.str + 1;
char *expr_start = template_start_token.str + 1;
char *expr_end = token.str;
int expr_len = static_cast<int>(expr_end - expr_start);