diff options
author | albert-github <albert.tests@gmail.com> | 2020-09-08 09:41:40 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-09-08 09:41:40 (GMT) |
commit | 8cabc84a0f7b741e84aabe45c97f7aeca0eb53e0 (patch) | |
tree | 2fad16ebab35daeb6a6043df082fbabaa0da38e2 | |
parent | b8398bdd9cb5498b1b3328feefd74a770420f342 (diff) | |
download | Doxygen-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
-rw-r--r-- | src/scanner.l | 16 |
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; } |