Skip to content

Commit bcfef14

Browse files
authored
Merge 2021-06 CWG Motion 1
P2386R0 Core Language Working Group "ready" Issues for the June, 2021 meeting
2 parents fb3bea8 + 15ad155 commit bcfef14

File tree

5 files changed

+115
-112
lines changed

5 files changed

+115
-112
lines changed

source/basic.tex

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5014,9 +5014,10 @@
50145014
Types
50155015
\keyword{bool},
50165016
\keyword{char}, \keyword{wchar_t},
5017-
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t},
5018-
and the signed and unsigned integer types are
5019-
collectively called
5017+
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and
5018+
the signed and unsigned integer types,
5019+
and cv-qualified versions\iref{basic.type.qualifier} thereof,
5020+
are collectively termed
50205021
\defnx{integral types}{integral type}.
50215022
A synonym for integral type is \defn{integer type}.
50225023
\begin{note}
@@ -5027,19 +5028,26 @@
50275028

50285029
\pnum
50295030
\indextext{floating-point type|see{type, floating-point}}%
5030-
There are three \defnx{floating-point types}{type!floating-point}:
5031+
The three distinct types
50315032
\indextext{type!\idxcode{float}}%
50325033
\keyword{float},
50335034
\indextext{type!\idxcode{double}}%
50345035
\keyword{double},
50355036
and
50365037
\indextext{type!\idxcode{long double}}%
5037-
\tcode{\keyword{long} \keyword{double}}. The type \keyword{double} provides at least as much
5038+
\tcode{\keyword{long} \keyword{double}}
5039+
can represent floating-point numbers.
5040+
The type \keyword{double} provides at least as much
50385041
precision as \keyword{float}, and the type \tcode{\keyword{long} \keyword{double}} provides at
50395042
least as much precision as \keyword{double}. The set of values of the type
50405043
\keyword{float} is a subset of the set of values of the type
50415044
\keyword{double}; the set of values of the type \keyword{double} is a subset
5042-
of the set of values of the type \tcode{\keyword{long} \keyword{double}}. The value
5045+
of the set of values of the type \tcode{\keyword{long} \keyword{double}}.
5046+
The types
5047+
\keyword{float}, \keyword{double}, and \tcode{\keyword{long} \keyword{double}},
5048+
and cv-qualified versions\iref{basic.type.qualifier} thereof,
5049+
are collectively termed \defnx{floating-point types}{type!floating-point}.
5050+
The value
50435051
representation of floating-point types is \impldef{value representation of
50445052
floating-point types}.
50455053
\indextext{floating-point type!implementation-defined}%
@@ -5048,7 +5056,7 @@
50485056
floating-point operations; see also~\ref{support.limits}.
50495057
\end{note}
50505058
Integral and floating-point types are collectively
5051-
called \defnx{arithmetic}{type!arithmetic} types.
5059+
termed \defnx{arithmetic types}{type!arithmetic}.
50525060
\indextext{\idxcode{numeric_limits}!specializations for arithmetic types}%
50535061
Specializations of the standard library template
50545062
\tcode{std::numeric_limits}\iref{support.limits} shall specify the
@@ -5267,18 +5275,22 @@
52675275
\indextext{cv-qualifier}%
52685276
\indextext{\idxcode{const}}%
52695277
\indextext{\idxcode{volatile}}%
5270-
A type mentioned in~\ref{basic.fundamental} and~\ref{basic.compound} is
5271-
a \defnadj{cv-unqualified}{type}. Each type which is a
5272-
cv-unqualified object type or is
5273-
\keyword{void}\iref{basic.types} has three corresponding cv-qualified
5274-
versions of its type: a \defn{const-qualified} version, a
5275-
\defn{volatile-qualified} version, and a
5276-
\defn{const-volatile-qualified} version. The
5277-
type of an object\iref{intro.object} includes the \grammarterm{cv-qualifier}{s}
5278-
specified in the \grammarterm{decl-specifier-seq}\iref{dcl.spec},
5279-
\grammarterm{declarator}\iref{dcl.decl},
5280-
\grammarterm{type-id}\iref{dcl.name}, or
5281-
\grammarterm{new-type-id}\iref{expr.new} when the object is created.
5278+
Each type other than a function or reference type
5279+
is part of a group of four distinct, but related, types:
5280+
a \defn{cv-unqualified} version,
5281+
a \defn{const-qualified} version,
5282+
a \defn{volatile-qualified} version, and
5283+
a \defn{const-volatile-qualified} version.
5284+
The types in each such group shall have
5285+
the same representation and alignment requirements\iref{basic.align}.
5286+
\begin{footnote}
5287+
The same representation and alignment requirements
5288+
are meant to imply interchangeability as
5289+
arguments to functions,
5290+
return values from functions, and
5291+
non-static data members of unions.
5292+
\end{footnote}
5293+
A function or reference type is always cv-unqualified.
52825294
\begin{itemize}
52835295
\item A \defnadj{const}{object} is an object of type \tcode{\keyword{const} T} or a
52845296
non-mutable subobject of a const object.
@@ -5291,16 +5303,15 @@
52915303
a const subobject of a volatile object, or a non-mutable volatile
52925304
subobject of a const object.
52935305
\end{itemize}
5294-
The cv-qualified or
5295-
cv-unqualified versions of a type
5296-
are distinct types; however, they shall have the same representation and
5297-
alignment requirements\iref{basic.align}.
5298-
\begin{footnote}
5299-
The same representation
5300-
and alignment requirements are meant to imply
5301-
interchangeability as arguments to functions, return values from
5302-
functions, and non-static data members of unions.
5303-
\end{footnote}
5306+
\begin{note}
5307+
The type of an object\iref{intro.object} includes
5308+
the \grammarterm{cv-qualifier}s specified in the
5309+
\grammarterm{decl-specifier-seq}\iref{dcl.spec},
5310+
\grammarterm{declarator}\iref{dcl.decl},
5311+
\grammarterm{type-id}\iref{dcl.name}, or
5312+
\grammarterm{new-type-id}\iref{expr.new}
5313+
when the object is created.
5314+
\end{note}
53045315

53055316
\pnum
53065317
Except for array types, a compound type\iref{basic.compound} is not cv-qualified by the
@@ -5663,28 +5674,27 @@
56635674
\end{example}
56645675

56655676
\pnum
5666-
When calling a function (whether or not the function is inline), every
5667-
\indextext{value computation}%
5668-
value computation and
5669-
\indextext{side effects}%
5670-
side effect associated with any argument
5671-
expression, or with the postfix expression designating the called
5672-
function, is sequenced before execution of every expression or statement
5677+
When invoking a function (whether or not the function is inline),
5678+
every argument expression and
5679+
the postfix expression designating the called function
5680+
are sequenced before every expression or statement
56735681
in the body of the called function.
5674-
For each function invocation \placeholder{F},
5675-
for every evaluation \placeholder{A} that occurs within \placeholder{F} and
5676-
every evaluation \placeholder{B} that does not occur within \placeholder{F} but
5677-
is evaluated on the same thread and as part of the same signal handler (if any),
5678-
either \placeholder{A} is sequenced before \placeholder{B} or
5679-
\placeholder{B} is sequenced before \placeholder{A}.
5682+
For each function invocation or
5683+
evaluation of an \grammarterm{await-expression} \placeholder{F},
5684+
each evaluation that does not occur within \placeholder{F} but
5685+
is evaluated on the same thread and as part of the same signal handler (if any)
5686+
is either sequenced before all evaluations that occur within \placeholder{F}
5687+
or sequenced after all evaluations that occur within \placeholder{F};
56805688
\begin{footnote}
56815689
In other words,
56825690
function executions do not interleave with each other.
56835691
\end{footnote}
5684-
\begin{note}
5685-
If \placeholder{A} and \placeholder{B} would not otherwise be sequenced then they are
5686-
indeterminately sequenced.
5687-
\end{note}
5692+
if \placeholder{F} invokes or resumes a coroutine\iref{expr.await},
5693+
only evaluations
5694+
subsequent to the previous suspension (if any) and
5695+
prior to the next suspension (if any)
5696+
are considered to occur within \placeholder{F}.
5697+
56885698
Several contexts in \Cpp{} cause evaluation of a function call, even
56895699
though no corresponding function call syntax appears in the translation
56905700
unit.
@@ -6419,7 +6429,7 @@
64196429
The linkage\iref{basic.link} of \tcode{main} is
64206430
\impldef{linkage of \tcode{main}}. A program that defines \tcode{main} as
64216431
deleted or that declares \tcode{main} to be
6422-
\keyword{inline}, \keyword{static}, or \keyword{constexpr} is ill-formed.
6432+
\keyword{inline}, \keyword{static}, \keyword{constexpr}, or \keyword{consteval} is ill-formed.
64236433
The function \tcode{main} shall not be a coroutine\iref{dcl.fct.def.coroutine}.
64246434
The \tcode{main} function shall not be declared with a
64256435
\grammarterm{linkage-specification}\iref{dcl.link}.

source/classes.tex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,12 @@
11411141
\end{itemize}
11421142
Constructors do not have names.
11431143
In a constructor declaration, each \grammarterm{decl-specifier} in the optional
1144-
\grammarterm{decl-specifier-seq} shall be \keyword{friend}, \keyword{inline},
1145-
\keyword{constexpr}, or an \grammarterm{explicit-specifier}.
1144+
\grammarterm{decl-specifier-seq} shall be
1145+
\keyword{friend},
1146+
\keyword{inline},
1147+
\keyword{constexpr},
1148+
\keyword{consteval}, or
1149+
an \grammarterm{explicit-specifier}.
11461150
\begin{example}
11471151
\begin{codeblock}
11481152
struct S {
@@ -1480,7 +1484,7 @@
14801484
a non-explicit one is declared \defnx{implicitly}{constructor!copy!implicitly declared}.
14811485
If the class definition declares a move
14821486
constructor or move assignment operator, the implicitly declared copy
1483-
constructor is defined as deleted; otherwise, it is defined as
1487+
constructor is defined as deleted; otherwise, it is
14841488
defaulted\iref{dcl.fct.def}.
14851489
The latter case is deprecated if the class has a user-declared copy assignment
14861490
operator or a user-declared destructor \iref{depr.impldec}.
@@ -1734,7 +1738,7 @@
17341738
one is declared \defnx{implicitly}{assignment operator!copy!implicitly declared}.
17351739
If the class definition declares a move
17361740
constructor or move assignment operator, the implicitly declared copy
1737-
assignment operator is defined as deleted; otherwise, it is defined as
1741+
assignment operator is defined as deleted; otherwise, it is
17381742
defaulted\iref{dcl.fct.def}.
17391743
The latter case is deprecated if the class has a user-declared copy constructor
17401744
or a user-declared destructor \iref{depr.impldec}.

source/declarations.tex

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,6 +1924,7 @@
19241924
and $E$ is the corresponding template argument.
19251925
\end{itemize}
19261926

1927+
\tcode{T} shall not be an array type.
19271928
In the case of a \tcode{return} statement with no operand
19281929
or with an operand of type \keyword{void},
19291930
\tcode{T} shall be either
@@ -2616,6 +2617,8 @@
26162617
\keyword{inline},
26172618
\keyword{virtual},
26182619
\keyword{constexpr},
2620+
\keyword{consteval},
2621+
\keyword{constinit},
26192622
or
26202623
\tcode{typedef}
26212624
specifier
@@ -3143,7 +3146,6 @@
31433146
\pnum
31443147
\tcode{U} is called the array \defn{element type};
31453148
this type shall not be
3146-
a placeholder type\iref{dcl.spec.auto},
31473149
a reference type,
31483150
a function type,
31493151
an array of unknown bound, or
@@ -3606,6 +3608,9 @@
36063608
\indextext{function return type|see{return type}}%
36073609
\indextext{return type}%
36083610
The return type shall be a non-array object type, a reference type, or \cv{}~\keyword{void}.
3611+
\begin{note}
3612+
An array of placeholder type is considered an array type.
3613+
\end{note}
36093614

36103615
\pnum
36113616
A volatile-qualified return type is deprecated;
@@ -5492,9 +5497,10 @@
54925497
\item
54935498
Otherwise,
54945499
the initializer expression is implicitly converted to a prvalue
5495-
of type ``\cvqual{cv1} \tcode{T1}''.
5496-
The temporary materialization conversion is applied and the reference is
5497-
bound to the result.
5500+
of type ``\tcode{T1}''.
5501+
The temporary materialization conversion is applied,
5502+
considering the type of the prvalue to be ``\cvqual{cv1} \tcode{T1}'',
5503+
and the reference is bound to the result.
54985504
\end{itemize}
54995505

55005506
If
@@ -6362,6 +6368,11 @@
63626368
for a non-static member function, and
63636369
$\tcode{p}_i$ denotes
63646370
the $i^\textrm{th}$ function parameter otherwise.
6371+
For a non-static member function,
6372+
$\tcode{q}_1$ is an lvalue that denotes \tcode{*this};
6373+
any other $\tcode{q}_i$ is an lvalue
6374+
that denotes the parameter copy corresponding to $\tcode{p}_i$,
6375+
as described below.
63656376

63666377
\pnum
63676378
A coroutine behaves as if its \grammarterm{function-body} were replaced by:
@@ -6409,10 +6420,10 @@
64096420
\item
64106421
\placeholder{promise-constructor-arguments} is determined as follows:
64116422
overload resolution is performed on a promise constructor call created by
6412-
assembling an argument list with lvalues $\tcode{p}_1 \dotsc \tcode{p}_n$. If a viable
6423+
assembling an argument list $\tcode{q}_1 \dotsc \tcode{q}_n$. If a viable
64136424
constructor is found\iref{over.match.viable}, then
64146425
\placeholder{promise-constructor-arguments} is
6415-
\tcode{(p$_1$, $\dotsc$, p$_n$)}, otherwise
6426+
\tcode{($\tcode{q}_1$, $\dotsc$, $\tcode{q}_n$)}, otherwise
64166427
\placeholder{promise-constructor-arguments} is empty.
64176428
\end{itemize}
64186429

source/expressions.tex

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,15 +1581,23 @@
15811581
\grammarterm{decltype-specifier} \tcode{::} \tcode{\~} \grammarterm{type-name}.
15821582

15831583
\pnum
1584-
The result of a \grammarterm{qualified-id} is
1584+
The result of a \grammarterm{qualified-id} $Q$ is
15851585
the entity it denotes\iref{basic.lookup.qual}.
15861586
The type of the expression is the type of the result.
15871587
The result is an lvalue if the member is
1588-
a function,
1588+
\begin{itemize}
1589+
\item
1590+
a function other than a non-static member function,
1591+
\item
1592+
a non-static member function
1593+
if $Q$ is the operand of a unary \tcode{\&} operator,
1594+
\item
15891595
a variable,
1590-
a structured binding\iref{dcl.struct.bind},
1591-
a static member function, or
1596+
\item
1597+
a structured binding\iref{dcl.struct.bind}, or
1598+
\item
15921599
a data member,
1600+
\end{itemize}
15931601
and a prvalue otherwise.
15941602

15951603
\rSec3[expr.prim.id.dtor]{Destruction}
@@ -4313,22 +4321,21 @@
43134321
\pnum
43144322
\indextext{name!address of cv-qualified}%
43154323
\indextext{expression!pointer-to-member constant}%
4316-
The result of the unary \tcode{\&} operator is a pointer to its operand.
4324+
The operand of the unary \tcode{\&} operator
4325+
shall be an lvalue of some type \tcode{T}.
4326+
The result is a prvalue.
43174327
\begin{itemize}
43184328
\item
43194329
If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m}
4320-
of some class \tcode{C} with type \tcode{T}, the result has type ``pointer to member
4321-
of class \tcode{C} of type \tcode{T}'' and is a prvalue designating \tcode{C::m}.
4330+
of some class \tcode{C}, the result has type ``pointer to member
4331+
of class \tcode{C} of type \tcode{T}'' and designates \tcode{C::m}.
43224332
\item
4323-
Otherwise, if the operand is an lvalue of type \tcode{T},
4324-
the resulting expression is a prvalue of type ``pointer to \tcode{T}''
4325-
whose result is a pointer to the designated object\iref{intro.memory} or function.
4333+
Otherwise, the result has type ``pointer to \tcode{T}'' and points to
4334+
the designated object\iref{intro.memory} or function\iref{basic.compound}.
43264335
\begin{note}
43274336
In particular, taking the address of a variable of type ``\cv{}~\tcode{T}''
43284337
yields a pointer of type ``pointer to \cv{}~\tcode{T}''.
43294338
\end{note}
4330-
\item
4331-
Otherwise, the program is ill-formed.
43324339
\end{itemize}
43334340
\begin{example}
43344341
\begin{codeblock}
@@ -4602,6 +4609,10 @@
46024609
the \placeholder{await-resume} expression is evaluated, and
46034610
its result is the result of the \grammarterm{await-expression}.
46044611
\end{itemize}
4612+
\begin{note}
4613+
With respect to sequencing,
4614+
an \grammarterm{await-expression} is indivisible\iref{intro.execution}.
4615+
\end{note}
46054616

46064617
\pnum
46074618
\begin{example}
@@ -5450,14 +5461,14 @@
54505461
\pnum
54515462
\indextext{\idxcode{delete}!undefined}%
54525463
In a single-object delete expression, if the static type of the object to be
5453-
deleted is different from its dynamic type
5464+
deleted is not similar\iref{conv.qual} to its dynamic type
54545465
and the selected deallocation function (see below)
54555466
is not a destroying operator delete,
54565467
the static type shall be a base
54575468
class of the dynamic type of the object to be deleted and the static type shall
54585469
have a virtual destructor or the behavior is undefined. In an array delete
5459-
expression, if the dynamic type of the object to be deleted differs from its
5460-
static type, the behavior is undefined.
5470+
expression, if the dynamic type of the object to be deleted is not similar to
5471+
its static type, the behavior is undefined.
54615472

54625473
\pnum
54635474
The \grammarterm{cast-expression} in a \grammarterm{delete-expression} shall

0 commit comments

Comments
 (0)