Skip to content

P2462R0 Core Language Working Group "ready" Issues for the October, 2021 meeting #5030

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

Merged
merged 8 commits into from
Oct 15, 2021
13 changes: 10 additions & 3 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1832,9 +1832,7 @@
The implicitly-declared copy/move assignment operator for class
\tcode{X}
has the return type
\tcode{X\&};
it returns the object for which the assignment operator is invoked, that is,
the object assigned to.
\tcode{X\&}.
An implicitly-declared copy/move assignment operator is an
inline public member of its class.

Expand Down Expand Up @@ -1996,6 +1994,11 @@
the object that is the source of the copy,
a corresponding object $o$ nested within the destination is created,
and the lifetime of $o$ begins before the copy is performed.

\pnum
The implicitly-defined copy/move assignment operator for a class
returns the object for which the assignment operator is invoked,
that is, the object assigned to.
\indextext{assignment operator!move|)}
\indextext{assignment operator!copy|)}

Expand Down Expand Up @@ -3723,6 +3726,10 @@
\end{codeblock}
\end{example}

\pnum
The \grammarterm{ref-qualifier}, or lack thereof, of an overriding function
shall be the same as that of the overridden function.

\pnum
The return type of an overriding function shall be either identical to
the return type of the overridden function or \defnx{covariant}{return type!covariant} with
Expand Down
60 changes: 29 additions & 31 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@

\pnum
\indextext{promotion!integral}%
A prvalue of an integer type other than \keyword{bool}, \keyword{char16_t},
A prvalue of an integer type other than \keyword{bool}, \keyword{char8_t}, \keyword{char16_t},
\keyword{char32_t}, or \keyword{wchar_t} whose integer conversion
rank\iref{conv.rank} is less than the rank of \keyword{int} can be
converted to a prvalue of type \keyword{int} if \keyword{int} can represent
Expand All @@ -837,14 +837,14 @@
\indextext{type!underlying!\idxcode{wchar_t}}%
\indextext{type!underlying!\idxcode{char16_t}}%
\indextext{type!underlying!\idxcode{char32_t}}%
A prvalue of type \keyword{char16_t}, \keyword{char32_t}, or
A prvalue of type \keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or
\keyword{wchar_t}\iref{basic.fundamental} can be converted to a prvalue
of the first of the following types that can represent all the values of
its underlying type: \keyword{int}, \tcode{\keyword{unsigned} \keyword{int}}, \tcode{\keyword{long} \keyword{int}},
\tcode{\keyword{unsigned} \keyword{long} \keyword{int}}, \tcode{\keyword{long} \keyword{long} \keyword{int}},
or \tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}. If none of the types in that list can
represent all the values of its underlying type, a prvalue of type
\keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted
to a prvalue of its underlying type.

\pnum
Expand Down Expand Up @@ -2440,10 +2440,11 @@
\tcode{m1}, then
\tcode{m2}'s capture is transformed as follows:
\begin{itemize}
\item if \tcode{m1} captures the entity by copy,
\item If \tcode{m1} captures the entity by copy,
\tcode{m2} captures the corresponding
non-static data member of \tcode{m1}'s closure type;
\item if \tcode{m1} captures the entity by reference,
if \tcode{m1} is not mutable, the non-static data member is considered to be const-qualified.
\item If \tcode{m1} captures the entity by reference,
\tcode{m2} captures the same
entity captured by \tcode{m1}.
\end{itemize}
Expand Down Expand Up @@ -3062,9 +3063,17 @@

\pnum
Calling a function through an
expression whose function type is different
from the function type of the called function's
definition results in undefined behavior.
expression whose function type \tcode{E} is different
from the function type \tcode{F} of the called function's
definition results in undefined behavior
unless the type ``pointer to \tcode{F}'' can be converted
to the type ``pointer to \tcode{E}'' via a function pointer conversion\iref{conv.fctptr}.
\begin{note}
The exception applies when the expression has the type of a
potentially-throwing function, but the called function has
a non-throwing exception specification,
and the function types are otherwise the same.
\end{note}

\pnum
\indextext{function argument|see{argument}}%
Expand Down Expand Up @@ -7207,6 +7216,11 @@
that refers to a non-volatile object
whose lifetime began within the evaluation of $E$;

\item
an invocation of a destructor\iref{class.dtor} or a function call
whose \grammarterm{postfix-expression} names a pseudo-destructor\iref{expr.call},
in either case for an object whose lifetime did not begin within the evaluation of $E$;

\item
a \grammarterm{new-expression}\iref{expr.new},
unless the selected allocation function is
Expand Down Expand Up @@ -7310,30 +7324,14 @@
even if the actual evaluation of such a call
would otherwise fail the requirements for a core constant expression.
Similarly, the evaluation of a call to
\tcode{std::destroy_at},
\tcode{std::ranges::destroy_at},
\tcode{std::construct_at}, or
\tcode{std::ranges::construct_at}
\tcode{std::construct_at} or \tcode{std::ranges::construct_at}
does not disqualify $E$
from being a core constant expression unless:
\begin{itemize}
\item
for a call to \tcode{std::construct_at} or \tcode{std::ranges::construct_at},
the first argument, of type \tcode{T*},
does not point
to storage allocated with \tcode{std::allocator<T>} or
to an object whose lifetime began within the evaluation of $E$, or
the evaluation of the underlying constructor call
disqualifies $E$ from being a core constant expression, or
\item
for a call to \tcode{std::destroy_at} or \tcode{std::ranges::destroy_at},
the first argument, of type \tcode{T*},
does not point
to storage allocated with \tcode{std::allocator<T>} or
to an object whose lifetime began within the evaluation of $E$, or
the evaluation of the underlying destructor call
disqualifies $E$ from being a core constant expression.
\end{itemize}
from being a core constant expression unless
the first argument, of type \tcode{T*}, does not point
to storage allocated with \tcode{std::allocator<T>} or
to an object whose lifetime began within the evaluation of $E$, or
the evaluation of the underlying constructor call
disqualifies $E$ from being a core constant expression.

\pnum
An object \tcode{a} is said to have \defnadj{constant}{destruction} if:
Expand Down
2 changes: 1 addition & 1 deletion source/modules.tex
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
\end{note}

\pnum
A redeclaration of an entity or \grammarterm{typedef-name} $X$
A redeclaration of an entity $X$
is implicitly exported
if $X$ was introduced by an exported declaration;
otherwise it shall not be exported.
Expand Down
2 changes: 1 addition & 1 deletion source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7133,7 +7133,7 @@
\pnum
If a substitution results in an invalid type or expression, type deduction fails. An
invalid type or expression is one that would be ill-formed, with a diagnostic
required, if written using the substituted arguments.
required, if written in the same context using the substituted arguments.
\begin{note}
If no
diagnostic is required, the program is still ill-formed. Access checking is done
Expand Down