Skip to content

Commit bccf4c8

Browse files
authored
Merge 2021-10 CWG Motion 1
P2462R0 Core Language Working Group "ready" Issues for the October, 2021 meeting
2 parents 5cd5610 + e289781 commit bccf4c8

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

source/classes.tex

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,9 +1832,7 @@
18321832
The implicitly-declared copy/move assignment operator for class
18331833
\tcode{X}
18341834
has the return type
1835-
\tcode{X\&};
1836-
it returns the object for which the assignment operator is invoked, that is,
1837-
the object assigned to.
1835+
\tcode{X\&}.
18381836
An implicitly-declared copy/move assignment operator is an
18391837
inline public member of its class.
18401838

@@ -1996,6 +1994,11 @@
19961994
the object that is the source of the copy,
19971995
a corresponding object $o$ nested within the destination is created,
19981996
and the lifetime of $o$ begins before the copy is performed.
1997+
1998+
\pnum
1999+
The implicitly-defined copy/move assignment operator for a class
2000+
returns the object for which the assignment operator is invoked,
2001+
that is, the object assigned to.
19992002
\indextext{assignment operator!move|)}
20002003
\indextext{assignment operator!copy|)}
20012004

@@ -3723,6 +3726,10 @@
37233726
\end{codeblock}
37243727
\end{example}
37253728

3729+
\pnum
3730+
The \grammarterm{ref-qualifier}, or lack thereof, of an overriding function
3731+
shall be the same as that of the overridden function.
3732+
37263733
\pnum
37273734
The return type of an overriding function shall be either identical to
37283735
the return type of the overridden function or \defnx{covariant}{return type!covariant} with

source/expressions.tex

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@
826826

827827
\pnum
828828
\indextext{promotion!integral}%
829-
A prvalue of an integer type other than \keyword{bool}, \keyword{char16_t},
829+
A prvalue of an integer type other than \keyword{bool}, \keyword{char8_t}, \keyword{char16_t},
830830
\keyword{char32_t}, or \keyword{wchar_t} whose integer conversion
831831
rank\iref{conv.rank} is less than the rank of \keyword{int} can be
832832
converted to a prvalue of type \keyword{int} if \keyword{int} can represent
@@ -837,14 +837,14 @@
837837
\indextext{type!underlying!\idxcode{wchar_t}}%
838838
\indextext{type!underlying!\idxcode{char16_t}}%
839839
\indextext{type!underlying!\idxcode{char32_t}}%
840-
A prvalue of type \keyword{char16_t}, \keyword{char32_t}, or
840+
A prvalue of type \keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or
841841
\keyword{wchar_t}\iref{basic.fundamental} can be converted to a prvalue
842842
of the first of the following types that can represent all the values of
843843
its underlying type: \keyword{int}, \tcode{\keyword{unsigned} \keyword{int}}, \tcode{\keyword{long} \keyword{int}},
844844
\tcode{\keyword{unsigned} \keyword{long} \keyword{int}}, \tcode{\keyword{long} \keyword{long} \keyword{int}},
845845
or \tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}. If none of the types in that list can
846846
represent all the values of its underlying type, a prvalue of type
847-
\keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted
847+
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted
848848
to a prvalue of its underlying type.
849849

850850
\pnum
@@ -2440,10 +2440,11 @@
24402440
\tcode{m1}, then
24412441
\tcode{m2}'s capture is transformed as follows:
24422442
\begin{itemize}
2443-
\item if \tcode{m1} captures the entity by copy,
2443+
\item If \tcode{m1} captures the entity by copy,
24442444
\tcode{m2} captures the corresponding
24452445
non-static data member of \tcode{m1}'s closure type;
2446-
\item if \tcode{m1} captures the entity by reference,
2446+
if \tcode{m1} is not mutable, the non-static data member is considered to be const-qualified.
2447+
\item If \tcode{m1} captures the entity by reference,
24472448
\tcode{m2} captures the same
24482449
entity captured by \tcode{m1}.
24492450
\end{itemize}
@@ -3062,9 +3063,17 @@
30623063

30633064
\pnum
30643065
Calling a function through an
3065-
expression whose function type is different
3066-
from the function type of the called function's
3067-
definition results in undefined behavior.
3066+
expression whose function type \tcode{E} is different
3067+
from the function type \tcode{F} of the called function's
3068+
definition results in undefined behavior
3069+
unless the type ``pointer to \tcode{F}'' can be converted
3070+
to the type ``pointer to \tcode{E}'' via a function pointer conversion\iref{conv.fctptr}.
3071+
\begin{note}
3072+
The exception applies when the expression has the type of a
3073+
potentially-throwing function, but the called function has
3074+
a non-throwing exception specification,
3075+
and the function types are otherwise the same.
3076+
\end{note}
30683077

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

7219+
\item
7220+
an invocation of a destructor\iref{class.dtor} or a function call
7221+
whose \grammarterm{postfix-expression} names a pseudo-destructor\iref{expr.call},
7222+
in either case for an object whose lifetime did not begin within the evaluation of $E$;
7223+
72107224
\item
72117225
a \grammarterm{new-expression}\iref{expr.new},
72127226
unless the selected allocation function is
@@ -7310,30 +7324,14 @@
73107324
even if the actual evaluation of such a call
73117325
would otherwise fail the requirements for a core constant expression.
73127326
Similarly, the evaluation of a call to
7313-
\tcode{std::destroy_at},
7314-
\tcode{std::ranges::destroy_at},
7315-
\tcode{std::construct_at}, or
7316-
\tcode{std::ranges::construct_at}
7327+
\tcode{std::construct_at} or \tcode{std::ranges::construct_at}
73177328
does not disqualify $E$
7318-
from being a core constant expression unless:
7319-
\begin{itemize}
7320-
\item
7321-
for a call to \tcode{std::construct_at} or \tcode{std::ranges::construct_at},
7322-
the first argument, of type \tcode{T*},
7323-
does not point
7324-
to storage allocated with \tcode{std::allocator<T>} or
7325-
to an object whose lifetime began within the evaluation of $E$, or
7326-
the evaluation of the underlying constructor call
7327-
disqualifies $E$ from being a core constant expression, or
7328-
\item
7329-
for a call to \tcode{std::destroy_at} or \tcode{std::ranges::destroy_at},
7330-
the first argument, of type \tcode{T*},
7331-
does not point
7332-
to storage allocated with \tcode{std::allocator<T>} or
7333-
to an object whose lifetime began within the evaluation of $E$, or
7334-
the evaluation of the underlying destructor call
7335-
disqualifies $E$ from being a core constant expression.
7336-
\end{itemize}
7329+
from being a core constant expression unless
7330+
the first argument, of type \tcode{T*}, does not point
7331+
to storage allocated with \tcode{std::allocator<T>} or
7332+
to an object whose lifetime began within the evaluation of $E$, or
7333+
the evaluation of the underlying constructor call
7334+
disqualifies $E$ from being a core constant expression.
73377335

73387336
\pnum
73397337
An object \tcode{a} is said to have \defnadj{constant}{destruction} if:

source/modules.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
\end{note}
316316

317317
\pnum
318-
A redeclaration of an entity or \grammarterm{typedef-name} $X$
318+
A redeclaration of an entity $X$
319319
is implicitly exported
320320
if $X$ was introduced by an exported declaration;
321321
otherwise it shall not be exported.

source/templates.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7133,7 +7133,7 @@
71337133
\pnum
71347134
If a substitution results in an invalid type or expression, type deduction fails. An
71357135
invalid type or expression is one that would be ill-formed, with a diagnostic
7136-
required, if written using the substituted arguments.
7136+
required, if written in the same context using the substituted arguments.
71377137
\begin{note}
71387138
If no
71397139
diagnostic is required, the program is still ill-formed. Access checking is done

0 commit comments

Comments
 (0)