Open xmh0511 opened 2 years ago
Note that [class.ctor] and [class.dtor] directly refer to special cases of [dcl.fct]. The real issue is that [dcl.fct] does not, but should, describe the syntactic form of constructors and destructors.
The real issue is that [dcl.fct] does not, but should, describe the syntactic form of constructors and destructors.
Yes, [dcl.fct] should cover the constructor and destructor cases. Moreover, [dcl.fct] should clarify what is "function declarator" and define that term; this is a Stackoverflow question: Is a pointer to function (sometimes/always?) a function declarator?
[dcl.fct.def.general] p2 says
The latter form
declarator ;
presumably refers to the declaration of a constructor or destructor. However, it is not described in [dcl.fct]. In [dcl.fct], the declaration described in either [dcl.fct] p1 or p2 should have the formT D;
whereT
should comprise a valid type since the function type "returning T", in either form. This option has confirmed in https://github.com/cplusplus/draft/pull/4737#discussion_r785042207So, for the latter case, it should cross-reference [class.ctor] and [class.dtor] instead of [dcl.fct].