Skip to content

[class.init] Replace abominable temporary expression wording #4235

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5782,7 +5782,8 @@
not the most derived class.

\pnum
A temporary expression bound to a reference member in a \grammarterm{mem-initializer}
A program extending the lifetime of a temporary object
by binding it to a reference member in a \grammarterm{mem-initializer}
is ill-formed.
Comment on lines -5785 to 5787
Copy link
Member

Choose a reason for hiding this comment

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

Can we phrase this as a regular "shall not" rule, rather than "A program ... is ill-formed"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something like: "A program shall not (attempt to?) extend the lifetime of a temporary object by binding it to a reference member ..."?

\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -5888,7 +5889,8 @@
\end{example}

\pnum
A temporary expression bound to a reference member from a
A program extending the lifetime of a temporary object
by binding it to a reference member from a
default member initializer is ill-formed.
\begin{example}
\begin{codeblock}
Expand Down