From Jason Turner

[expr.call]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpb9pt5szu/{from.md → to.md} +37 -36
tmp/tmpb9pt5szu/{from.md → to.md} RENAMED
@@ -1,49 +1,50 @@
1
  ### Function call <a id="expr.call">[[expr.call]]</a>
2
 
3
- There are two kinds of function call: ordinary function call and member
4
- function[^6] ([[class.mfct]]) call. A function call is a postfix
5
- expression followed by parentheses containing a possibly empty,
6
- comma-separated list of expressions which constitute the arguments to
7
- the function. For an ordinary function call, the postfix expression
8
- shall be either an lvalue that refers to a function (in which case the
9
- function-to-pointer standard conversion ([[conv.func]]) is suppressed
10
- on the postfix expression), or it shall have pointer to function type.
11
- Calling a function through an expression whose function type has a
12
- language linkage that is different from the language linkage of the
13
- function type of the called function’s definition is undefined (
14
- [[dcl.link]]). For a member function call, the postfix expression shall
15
- be an implicit ([[class.mfct.non-static]],  [[class.static]]) or
16
- explicit class member access ([[expr.ref]]) whose *id-expression* is a
17
- function member name, or a pointer-to-member expression (
18
- [[expr.mptr.oper]]) selecting a function member; the call is as a member
19
- of the class object referred to by the object expression. In the case of
20
- an implicit class member access, the implied object is the one pointed
21
- to by `this`. a member function call of the form `f()` is interpreted as
22
- `(*this).f()` (see  [[class.mfct.non-static]]). If a function or member
23
- function name is used, the name can be overloaded (Clause  [[over]]), in
24
- which case the appropriate function shall be selected according to the
25
- rules in  [[over.match]]. If the selected function is non-virtual, or if
26
- the *id-expression* in the class member access expression is a
 
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. the dynamic type is the type of the object
30
- referred to by the current value of the object expression.
31
- [[class.cdtor]] describes the behavior of virtual function calls when
32
- the object expression refers to an object under construction or
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 an
44
- object type, a reference type or the type `void`.
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 argument
122
- expressions are all unsequenced relative to one another. All side
123
- effects of argument expression evaluations are sequenced before the
124
- function is entered (see  [[intro.execution]]).
125
 
126
- Recursive calls are permitted, except to the function named `main` (
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.