Handle function pointer parameters where the return value is a reference

- Fixes #17
This commit is contained in:
Dustin Spicuzza
2021-11-26 00:11:36 -05:00
parent b1808f77ad
commit c7d480e8c3
2 changed files with 141 additions and 1 deletions

View File

@@ -1503,7 +1503,6 @@ class CxxParser:
param = self._parse_parameter(None, Parameter)
params.append(param)
tok = self._next_token_must_be(",", ")")
if tok.value == ")":
break
@@ -1812,6 +1811,11 @@ class CxxParser:
else:
dtype = MoveReference(dtype)
# peek at the next token and see if it's a paren. If so, it might
# be a nasty function pointer
if self.lex.token_peek_if("("):
dtype = self._parse_cv_ptr(dtype, nonptr_fn)
return dtype
# Applies to variables and return values