You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong
Reference (section label): dcl.fct.def.general
Link to reflector thread (if any): N/A
Issue description: https://wg21.link/dcl.fct.def.general#1 explains that various actions performed by constructors without syntactically being present are considered part of the body of the constructor. No similar statement is made with respect to destructors.
Suggested resolution:
Any informal reference to the body of a function should be interpreted as a reference to the non-terminal function-body, including, for. For a constructor this includes, default member initializers or default initialization used to initialize a base or member subobject in the absence of a mem-initializer-id ([class.base.init]). Similarly, for a destructor, this includes any calling of destructors of members and bases by the destructor ([class.dtor]).
The text was updated successfully, but these errors were encountered:
In my opinion, it is more about location than about actions, i.e. that default member initializers are in the context of function-body, for example, for the purposes of the paragraph below about using incomplete types, or for the purposes of the inlining
In my opinion, it is more about location than about actions, i.e. that default member initializers are in the context of function-body, for example, for the purposes of the paragraph below about using incomplete types, or for the purposes of the inlining
If it made sense for "default initialization" (maybe for access checking or point of instantiation), then it makes sense for the destruction.
jensmaurer
changed the title
[dcl.fct.def.general] Informal references to the "body" of a destructor
CWG2993 [dcl.fct.def.general] Informal references to the "body" of a destructor
Feb 23, 2025
Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong
Reference (section label): dcl.fct.def.general
Link to reflector thread (if any): N/A
Issue description:
https://wg21.link/dcl.fct.def.general#1 explains that various actions performed by constructors without syntactically being present are considered part of the body of the constructor. No similar statement is made with respect to destructors.
Suggested resolution:
Any informal reference to the body of a function should be interpreted as a reference to the non-terminal function-body
, including, for. For a constructor this includes,default member initializers or default initialization used to initialize a base or member subobject in the absence of a mem-initializer-id ([class.base.init]). Similarly, for a destructor, this includes any calling of destructors of members and bases by the destructor ([class.dtor]).The text was updated successfully, but these errors were encountered: