-
Notifications
You must be signed in to change notification settings - Fork 7
CWG2715 [expr.call] "Calling function" is not clearly defined, and may not exist #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Where exactly do we say that? |
I've altered the proposed resolution so that it keeps the general thrust of "in the calling function" instead of limiting the normative rule to access control. |
http://eel.is/c++draft/except.throw#2 explains how to find the nearest handler. Any try-block or function-try-block has not been "entered" yet if the parameters are still being initialized. |
Well, it still seems possible to (e.g.) destroy a parameter inside the called function, making the function-try-block relevant. We don't want that, so we should have a general rule that parameters are created and destroyed in the caller's context. |
Full name of submitter: Brian Bi
Reference (section label): [expr.call]
Issue description: [expr.call]/6 states: "[...] The initialization and destruction of each parameter occurs within the context of the calling function." However, a function call that is a subexpression of an init-declarator for a non-local variable does not have a calling function, and some expressions that are evaluated during translation do not have calling functions:
Example 2 suggests that the purpose of this sentence is to clarify access control and exception handling. Are there any other language concepts that care about whether the context is that of the caller or the callee?
Suggested resolution:
Edit [expr.call]/6:
The text was updated successfully, but these errors were encountered: