Skip to content

Commit

Permalink
issue #8465 Parens in return type template are dropped
Browse files Browse the repository at this point in the history
The "(" was eaten when the sharp parens ended but not the number of round brackets so exter condition required.
  • Loading branch information
albert-github committed Mar 29, 2021
1 parent 42bac34 commit 3770392
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,8 @@ NONLopt [^\n]*
lineCount(yyscanner);
yyextra->current->name+='>';
// *yyextra->currentTemplateSpec+='>';
if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
--yyextra->sharpCount;
if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
{
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
Expand All @@ -1925,6 +1926,11 @@ NONLopt [^\n]*
//printf("Found %s\n",yyextra->current->name.data());
BEGIN( ReadFuncArgType ) ;
}
else if (yyextra->sharpCount<=0)
{
yyextra->current->name+="(";
yyextra->roundCount++;
}
}
<EndTemplate>">"{BNopt}/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
lineCount(yyscanner);
Expand Down

0 comments on commit 3770392

Please sign in to comment.