|
191 | 191 |
|
192 | 192 | \p Parameters are either \textit{input parameters}, \textit{output parameters}, |
193 | 193 | or \textit{input/output parameters} as denoted in the called function's |
194 | | -declaration (\ref{Decl.Function}). |
| 194 | +declaration (\ref{Decl.Function}). For all types of parameters the argument |
| 195 | +expressions are evaluated before the function call occurs. |
195 | 196 |
|
196 | 197 | \p \textit{Input parameters} are passed by-value into a function. If an argument |
197 | 198 | to an \textit{input parameter} is of constant-sized array type, the array is |
|
207 | 208 | undefined behavior to not explicitly initialize an \textit{output parameter} |
208 | 209 | before returning from the function in which it is defined. The cxvalue created |
209 | 210 | from an argument to an \textit{input/output parameter} is initialized through |
210 | | -copy-initialization from the lvalue argument expression. In both cases, the |
211 | | -cxvalue shall have the type of the parameter and the argument can be converted |
212 | | -to that type through implicit or explicit conversion. |
| 211 | +copy-initialization from the lvalue argument expression. Overload resolution |
| 212 | +shall occur on argument initialization as if the expression \texttt{T Param = |
| 213 | +Arg} were evaluated. In both cases, the cxvalue shall have the type of the |
| 214 | +parameter and the argument can be converted to that type through implicit or |
| 215 | +explicit conversion. |
213 | 216 |
|
214 | 217 | \p If an argument to an \textit{output} or \textit{input/output parameter} is a |
215 | 218 | constant sized array, the array is copied to a temporary cxvalue following the |
|
222 | 225 | \texttt{T[N]}. |
223 | 226 |
|
224 | 227 | \p On expiration of the cxvalue, the value is assigned back to the argument |
225 | | -lvalue expression following an inverted conversion if applicable. The argument |
226 | | -expression must be of a type or able to convert to a type that has defined |
227 | | -copy-initialization to and from the parameter type. The lifetime of the cxvalue |
228 | | -begins at argument expression evaluation, and ends after the function returns. A |
229 | | -cxvalue argument is passed by-address to the caller. |
| 228 | +lvalue expression using a resolved assignment expression as if the expression |
| 229 | +\texttt{Arg = Param} were written\footnote{The argument expression is not |
| 230 | +re-evaluated after the call, so any side effects of the call occur only before |
| 231 | +the call.}. The argument expression must be of a type or able to convert to a |
| 232 | +type that has defined copy-initialization to and assignment from the parameter |
| 233 | +type. The lifetime of the cxvalue begins at argument expression evaluation, and |
| 234 | +ends after the function returns. A cxvalue argument is passed by-address to the |
| 235 | +caller. |
230 | 236 |
|
231 | 237 | \p If the lvalue passed to an \textit{output} or \textit{input/output parameter} |
232 | 238 | does not alias any other parameter passed to that function, an implementation |
|
0 commit comments