Skip to content

Commit d9d5e07

Browse files
committed
issue #10369 Found ';' while parsing initializer list! for member function pointer
1 parent e34f745 commit d9d5e07

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/doxygen.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2579,13 +2579,17 @@ static int findFunctionPtr(const std::string &type,SrcLangExt lang, int *pLength
25792579
}
25802580
size_t bb=type.find('<');
25812581
size_t be=type.rfind('>');
2582+
bool templFp = false;
2583+
if (be!=std::string::npos) {
2584+
templFp = type.find("::*")>be || type.find("::&")>be; // hack to find, e.g 'B<X>(A<int>::*)'
2585+
}
25822586

25832587
if (!type.empty() && // return type is non-empty
25842588
i!=std::string::npos && // contains (...*...)
25852589
type.find("operator")==std::string::npos && // not an operator
25862590
(type.find(")(")==std::string::npos || type.find("typedef ")!=std::string::npos) &&
25872591
// not a function pointer return type
2588-
!(bb<i && i<be) // bug665855: avoid treating "typedef A<void (T*)> type" as a function pointer
2592+
(!(bb<i && i<be) || templFp) // bug665855: avoid treating "typedef A<void (T*)> type" as a function pointer
25892593
)
25902594
{
25912595
if (pLength) *pLength=static_cast<int>(l);

src/scanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ NONLopt [^\n]*
21032103
yyextra->roundCount++;
21042104
}
21052105
}
2106-
<EndTemplate>">"{BNopt}/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
2106+
<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
21072107
lineCount(yyscanner);
21082108
yyextra->current->name+='>';
21092109
if (yyextra->roundCount==0)

0 commit comments

Comments
 (0)