Add throw/noexcept tests

This commit is contained in:
Dustin Spicuzza
2022-12-09 03:28:50 -05:00
parent 8a0568c0f5
commit ace1d09d9d
3 changed files with 102 additions and 1 deletions

View File

@@ -1653,7 +1653,7 @@ class CxxParser:
if self.lex.token_if("throw"):
tok = self._next_token_must_be("(")
fn.throw = self._create_value(self._consume_balanced_tokens(tok))
fn.throw = self._create_value(self._consume_balanced_tokens(tok)[1:-1])
elif self.lex.token_if("noexcept"):
toks = []

View File

@@ -514,7 +514,12 @@ class Function:
template: typing.Optional[TemplateDecl] = None
#: Value of any throw specification for this function. The value omits the
#: outer parentheses.
throw: typing.Optional[Value] = None
#: Value of any noexcept specification for this function. The value omits
#: the outer parentheses.
noexcept: typing.Optional[Value] = None
#: Only set if an MSVC calling convention (__stdcall, etc) is explictly