Commit 496c0fd9 authored by Robert Bradshaw's avatar Robert Bradshaw

Disallow C++ exception declarations for non-extern functions.

parent 56143d0b
...@@ -2078,6 +2078,10 @@ class CFuncDefNode(FuncDefNode): ...@@ -2078,6 +2078,10 @@ class CFuncDefNode(FuncDefNode):
"Function with optional arguments may not be declared " "Function with optional arguments may not be declared "
"public or api") "public or api")
if (type.exception_check == '+' and self.visibility != 'extern'):
error(self.cfunc_declarator.pos,
"Only extern functions can throw C++ exceptions.")
for formal_arg, type_arg in zip(self.args, type.args): for formal_arg, type_arg in zip(self.args, type.args):
self.align_argument_type(env, type_arg) self.align_argument_type(env, type_arg)
formal_arg.type = type_arg.type formal_arg.type = type_arg.type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment