summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-09-08 09:41:40 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-09-08 09:41:40 (GMT)
commit8cabc84a0f7b741e84aabe45c97f7aeca0eb53e0 (patch)
tree2fad16ebab35daeb6a6043df082fbabaa0da38e2 /src/scanner.l
parentb8398bdd9cb5498b1b3328feefd74a770420f342 (diff)
downloadDoxygen-8cabc84a0f7b741e84aabe45c97f7aeca0eb53e0.zip
Doxygen-8cabc84a0f7b741e84aabe45c97f7aeca0eb53e0.tar.gz
Doxygen-8cabc84a0f7b741e84aabe45c97f7aeca0eb53e0.tar.bz2
issue #8017 C++: mishandling of brackets used in trailing return types
Handle `{` and `;` inside, nested, round brackets not as end of return type
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l
index e56f151..5aa7e53 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -4583,13 +4583,29 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
lineCount(yyscanner);
yyextra->current->argList.setTrailingReturnType(" -> ");
yyextra->current->args += " -> ";
+ yyextra->roundCount=0;
BEGIN(TrailingReturn);
}
<TrailingReturn>[{;] {
+ if (yyextra->roundCount!= 0) REJECT;
unput(*yytext);
BEGIN(FuncQual);
}
<TrailingReturn>. {
+ if (*yytext == '(') yyextra->roundCount++;
+ else if (*yytext == ')')
+ {
+ if (yyextra->roundCount)
+ {
+ yyextra->roundCount--;
+ }
+ else
+ {
+ warn(yyextra->yyFileName,yyextra->yyLineNr,
+ "Found ')' without opening '(' for '%s)...'",
+ yyextra->current->argList.trailingReturnType().data());
+ }
+ }
yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
yyextra->current->args+=yytext;
}