CWG Issue 2145 (original) (raw)

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13


2145. Parenthesized declarator in function definition

Section: 9.6.1 [dcl.fct.def.general]Status: CD4Submitter: Richard SmithDate: 2015-06-19

[Adopted at the June, 2016 meeting.]

According to 9.6.1 [dcl.fct.def.general] paragraph 2,

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

However, in practice implementations accept a parenthesized declarator in a function definition.

Proposed resolution (April, 2016):

Change 9.6.1 [dcl.fct.def.general] paragraph 2 as follows:

The declarator in In a function-definition shall have the form,

D1 parameters-and-qualifiers trailing-return-typeopt

either void declarator ; or_declarator_ ; shall be a well-formed function declarator as described in 9.3.4.6 [dcl.fct]. A function shall be defined only in namespace or class scope.