Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-references between [basic.life], #6058

Closed
wants to merge 2 commits into from

Conversation

ecatmur
Copy link

@ecatmur ecatmur commented Jan 24, 2023

[class.cdtor] and [except.handle].

To resolve confusion noted in
cplusplus/CWG#204

@ecatmur ecatmur marked this pull request as ready for review January 24, 2023 10:35
@AlisdairM
Copy link
Contributor

Now that pseudo-destructors also end the lifetime of scalar objects, is there a latent Core issue lurking here?

@ecatmur
Copy link
Author

ecatmur commented Jan 25, 2023

Now that pseudo-destructors also end the lifetime of scalar objects, is there a latent Core issue lurking here?

I don't feel there is. A scalar pseudo-destructor is necessarily trivial, so [class.cdtor] isn't needed, and [basic.life] is written in terms of destruction of the object, which is what a pseudo-destructor does https://eel.is/c++draft/expr.call#5.sentence-2 . Am I missing something?

@tkoeppe
Copy link
Contributor

tkoeppe commented Aug 16, 2023

These references may be helpful. @jensmaurer do you think there could be a more concise way of placing those references?

Comment on lines +3454 to +3456
\begin{note}
For an object with a non-trivial constructor or destructor, see also~\ref{class.cdtor}.
\end{note}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this cross-reference in line 3425:

For an object under construction or destruction, see~\ref{class.cdtor}.

In general, [class.cdtor] describes behavior for objects under construction or destruction, and [basic.life] describes behavior for objects that are (entirely) out-of-lifetime.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, "object" might be a subobject.

Comment on lines +3507 to +3509
\begin{note}
For an object with a non-trivial constructor or destructor, see also~\ref{class.cdtor}.
\end{note}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, see line 3492.

@jensmaurer
Copy link
Member

@tkoeppe, I'm not happy about the verbose notes, and I'm not sure they clarify anything.

If there is some problem with the wording (e.g. because [class.cdtor] wants to be in [basic.life]), we should entertain that as a CWG issue with a specific suggestion for a change.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 9, 2023

@ecatmur Could you please file a CWG issue if there is a need for clarification?

@tkoeppe tkoeppe closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants