tmp/tmpb9pt5szu/{from.md → to.md}
RENAMED
|
@@ -1,49 +1,50 @@
|
|
| 1 |
### Function call <a id="expr.call">[[expr.call]]</a>
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
shall be either an lvalue that refers
|
| 9 |
-
function-to-pointer standard
|
| 10 |
-
on the postfix expression), or
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
function type of the called function’s
|
| 14 |
-
[[dcl.link]]). For a
|
| 15 |
-
be an implicit (
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
[[expr.mptr.oper]]) selecting a
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
`(*this).f()` (see
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
*qualified-id*, that function is called. Otherwise, its final
|
| 28 |
overrider ([[class.virtual]]) in the dynamic type of the object
|
| 29 |
-
expression is called
|
| 30 |
-
|
| 31 |
-
[[class.cdtor]] describes the
|
| 32 |
-
|
| 33 |
-
destruction.
|
| 34 |
|
| 35 |
If a function or member function name is used, and name lookup (
|
| 36 |
[[basic.lookup]]) does not find a declaration of that name, the program
|
| 37 |
is ill-formed. No function is implicitly declared by such a call.
|
| 38 |
|
| 39 |
If the *postfix-expression* designates a destructor ([[class.dtor]]),
|
| 40 |
the type of the function call expression is `void`; otherwise, the type
|
| 41 |
of the function call expression is the return type of the statically
|
| 42 |
chosen function (i.e., ignoring the `virtual` keyword), even if the type
|
| 43 |
-
of the function actually called is different. This type shall be
|
| 44 |
-
object type, a reference type or
|
| 45 |
|
| 46 |
When a function is called, each parameter ([[dcl.fct]]) shall be
|
| 47 |
initialized ([[dcl.init]], [[class.copy]], [[class.ctor]]) with its
|
| 48 |
corresponding argument. Such initializations are indeterminately
|
| 49 |
sequenced with respect to each other ([[intro.execution]]) If the
|
|
@@ -116,16 +117,16 @@ enumeration type that is subject to the integral promotions (
|
|
| 116 |
[[conv.prom]]), or a floating point type that is subject to the floating
|
| 117 |
point promotion ([[conv.fpprom]]), the value of the argument is
|
| 118 |
converted to the promoted type before the call. These promotions are
|
| 119 |
referred to as the *default argument promotions*.
|
| 120 |
|
| 121 |
-
The evaluations of the postfix expression and of the
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
|
| 126 |
-
Recursive calls are permitted, except to the
|
| 127 |
[[basic.start.main]]).
|
| 128 |
|
| 129 |
A function call is an lvalue if the result type is an lvalue reference
|
| 130 |
type or an rvalue reference to function type, an xvalue if the result
|
| 131 |
type is an rvalue reference to object type, and a prvalue otherwise.
|
|
|
|
| 1 |
### Function call <a id="expr.call">[[expr.call]]</a>
|
| 2 |
|
| 3 |
+
A function call is a postfix expression followed by parentheses
|
| 4 |
+
containing a possibly empty, comma-separated list of
|
| 5 |
+
*initializer-clause*s which constitute the arguments to the function.
|
| 6 |
+
The postfix expression shall have function type or pointer to function
|
| 7 |
+
type. For a call to a non-member function or to a static member
|
| 8 |
+
function, the postfix expression shall be either an lvalue that refers
|
| 9 |
+
to a function (in which case the function-to-pointer standard
|
| 10 |
+
conversion ([[conv.func]]) is suppressed on the postfix expression), or
|
| 11 |
+
it shall have pointer to function type. Calling a function through an
|
| 12 |
+
expression whose function type has a language linkage that is different
|
| 13 |
+
from the language linkage of the function type of the called function’s
|
| 14 |
+
definition is undefined ([[dcl.link]]). For a call to a non-static
|
| 15 |
+
member function, the postfix expression shall be an implicit (
|
| 16 |
+
[[class.mfct.non-static]], [[class.static]]) or explicit class member
|
| 17 |
+
access ([[expr.ref]]) whose *id-expression* is a function member name,
|
| 18 |
+
or a pointer-to-member expression ([[expr.mptr.oper]]) selecting a
|
| 19 |
+
function member; the call is as a member of the class object referred to
|
| 20 |
+
by the object expression. In the case of an implicit class member
|
| 21 |
+
access, the implied object is the one pointed to by `this`. a member
|
| 22 |
+
function call of the form `f()` is interpreted as `(*this).f()` (see
|
| 23 |
+
[[class.mfct.non-static]]). If a function or member function name is
|
| 24 |
+
used, the name can be overloaded (Clause [[over]]), in which case the
|
| 25 |
+
appropriate function shall be selected according to the rules in
|
| 26 |
+
[[over.match]]. If the selected function is non-virtual, or if the
|
| 27 |
+
*id-expression* in the class member access expression is a
|
| 28 |
*qualified-id*, that function is called. Otherwise, its final
|
| 29 |
overrider ([[class.virtual]]) in the dynamic type of the object
|
| 30 |
+
expression is called; such a call is referred to as a *virtual function
|
| 31 |
+
call*. the dynamic type is the type of the object referred to by the
|
| 32 |
+
current value of the object expression. [[class.cdtor]] describes the
|
| 33 |
+
behavior of virtual function calls when the object expression refers to
|
| 34 |
+
an object under construction or destruction.
|
| 35 |
|
| 36 |
If a function or member function name is used, and name lookup (
|
| 37 |
[[basic.lookup]]) does not find a declaration of that name, the program
|
| 38 |
is ill-formed. No function is implicitly declared by such a call.
|
| 39 |
|
| 40 |
If the *postfix-expression* designates a destructor ([[class.dtor]]),
|
| 41 |
the type of the function call expression is `void`; otherwise, the type
|
| 42 |
of the function call expression is the return type of the statically
|
| 43 |
chosen function (i.e., ignoring the `virtual` keyword), even if the type
|
| 44 |
+
of the function actually called is different. This return type shall be
|
| 45 |
+
an object type, a reference type or cv `void`.
|
| 46 |
|
| 47 |
When a function is called, each parameter ([[dcl.fct]]) shall be
|
| 48 |
initialized ([[dcl.init]], [[class.copy]], [[class.ctor]]) with its
|
| 49 |
corresponding argument. Such initializations are indeterminately
|
| 50 |
sequenced with respect to each other ([[intro.execution]]) If the
|
|
|
|
| 117 |
[[conv.prom]]), or a floating point type that is subject to the floating
|
| 118 |
point promotion ([[conv.fpprom]]), the value of the argument is
|
| 119 |
converted to the promoted type before the call. These promotions are
|
| 120 |
referred to as the *default argument promotions*.
|
| 121 |
|
| 122 |
+
The evaluations of the postfix expression and of the arguments are all
|
| 123 |
+
unsequenced relative to one another. All side effects of argument
|
| 124 |
+
evaluations are sequenced before the function is entered (see
|
| 125 |
+
[[intro.execution]]).
|
| 126 |
|
| 127 |
+
Recursive calls are permitted, except to the `main` function (
|
| 128 |
[[basic.start.main]]).
|
| 129 |
|
| 130 |
A function call is an lvalue if the result type is an lvalue reference
|
| 131 |
type or an rvalue reference to function type, an xvalue if the result
|
| 132 |
type is an rvalue reference to object type, and a prvalue otherwise.
|