tmp/tmp6crxd0tk/{from.md → to.md}
RENAMED
|
@@ -3,30 +3,34 @@
|
|
| 3 |
Function definitions have the form
|
| 4 |
|
| 5 |
``` bnf
|
| 6 |
function-definition:
|
| 7 |
attribute-specifier-seqₒₚₜ decl-specifier-seqₒₚₜ declarator virt-specifier-seqₒₚₜ function-body
|
|
|
|
| 8 |
```
|
| 9 |
|
| 10 |
``` bnf
|
| 11 |
function-body:
|
| 12 |
ctor-initializerₒₚₜ compound-statement
|
| 13 |
function-try-block
|
| 14 |
-
'= default ;'
|
| 15 |
-
'= delete ;'
|
| 16 |
```
|
| 17 |
|
| 18 |
Any informal reference to the body of a function should be interpreted
|
| 19 |
as a reference to the non-terminal *function-body*. The optional
|
| 20 |
*attribute-specifier-seq* in a *function-definition* appertains to the
|
| 21 |
function. A *virt-specifier-seq* can be part of a *function-definition*
|
| 22 |
-
only if it is a *member-declaration*
|
| 23 |
|
| 24 |
In a *function-definition*, either `void` *declarator* `;` or
|
| 25 |
*declarator* `;` shall be a well-formed function declaration as
|
| 26 |
described in [[dcl.fct]]. A function shall be defined only in namespace
|
| 27 |
-
or class scope.
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
[*Example 1*:
|
| 30 |
|
| 31 |
A simple example of a complete function definition is
|
| 32 |
|
|
@@ -69,13 +73,13 @@ definition of the form
|
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
static const char __func__[] = "function-name";
|
| 72 |
```
|
| 73 |
|
| 74 |
-
had been provided, where
|
| 75 |
string. It is unspecified whether such a variable has an address
|
| 76 |
-
distinct from that of any other object in the program.[^
|
| 77 |
|
| 78 |
[*Example 2*:
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
struct S {
|
|
|
|
| 3 |
Function definitions have the form
|
| 4 |
|
| 5 |
``` bnf
|
| 6 |
function-definition:
|
| 7 |
attribute-specifier-seqₒₚₜ decl-specifier-seqₒₚₜ declarator virt-specifier-seqₒₚₜ function-body
|
| 8 |
+
attribute-specifier-seqₒₚₜ decl-specifier-seqₒₚₜ declarator requires-clause function-body
|
| 9 |
```
|
| 10 |
|
| 11 |
``` bnf
|
| 12 |
function-body:
|
| 13 |
ctor-initializerₒₚₜ compound-statement
|
| 14 |
function-try-block
|
| 15 |
+
'=' default ';'
|
| 16 |
+
'=' delete ';'
|
| 17 |
```
|
| 18 |
|
| 19 |
Any informal reference to the body of a function should be interpreted
|
| 20 |
as a reference to the non-terminal *function-body*. The optional
|
| 21 |
*attribute-specifier-seq* in a *function-definition* appertains to the
|
| 22 |
function. A *virt-specifier-seq* can be part of a *function-definition*
|
| 23 |
+
only if it is a *member-declaration* [[class.mem]].
|
| 24 |
|
| 25 |
In a *function-definition*, either `void` *declarator* `;` or
|
| 26 |
*declarator* `;` shall be a well-formed function declaration as
|
| 27 |
described in [[dcl.fct]]. A function shall be defined only in namespace
|
| 28 |
+
or class scope. The type of a parameter or the return type for a
|
| 29 |
+
function definition shall not be a (possibly cv-qualified) class type
|
| 30 |
+
that is incomplete or abstract within the function body unless the
|
| 31 |
+
function is deleted [[dcl.fct.def.delete]].
|
| 32 |
|
| 33 |
[*Example 1*:
|
| 34 |
|
| 35 |
A simple example of a complete function definition is
|
| 36 |
|
|
|
|
| 73 |
|
| 74 |
``` cpp
|
| 75 |
static const char __func__[] = "function-name";
|
| 76 |
```
|
| 77 |
|
| 78 |
+
had been provided, where `function-name` is an *implementation-defined*
|
| 79 |
string. It is unspecified whether such a variable has an address
|
| 80 |
+
distinct from that of any other object in the program.[^8]
|
| 81 |
|
| 82 |
[*Example 2*:
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
struct S {
|