The change proposed in DR 2145 was responsible for the change in [dcl.fct.def.general]/2 from C++14 to C++17, as follows:
C++14:
The declarator in a function-definition shall have the form
D1 ( parameter-declaration-clause ) cv-qualifier-seqopt ref-qualifieropt
exception-specificationopt attribute-specifier-seqopt trailing-return-typeopt
as described in 8.3.5. A function shall be defined only in namespace or class scope.
C++17:
In a function-definition, either
voiddeclarator;or declarator;shall be a well-formed function declaration as described in 11.3.5. A function shall be defined only in namespace or class scope.
Frankly, I didn't understand the motivation for the change, neither the new wording in C++17.
As T.C. pointed out in the comment,
The intention is to allow stuff like
int (f()) { return 1; }which is banned by the previous wording but allowed in practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With