Skip to content

Commit 9ec95fe

Browse files
committed
P1306R5 Expansion Statements
Editorial notes: * [stmt.pre] The sentence moved up from [stmt.iter.gen] is moved _after_ the existing sentence instead of before. * [stmt.expand] Missing full stop included in Note 1.
1 parent 2e12f5e commit 9ec95fe

File tree

5 files changed

+288
-75
lines changed

5 files changed

+288
-75
lines changed

source/basic.tex

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,9 @@
12811281
The locus of a \grammarterm{for-range-declaration}
12821282
of a range-based \keyword{for} statement\iref{stmt.ranged}
12831283
is immediately after the \grammarterm{for-range-initializer}.
1284+
The locus of a \grammarterm{for-range-declaration}
1285+
of an expansion statement\iref{stmt.expand}
1286+
is immediately after the \grammarterm{expansion-initializer}.
12841287

12851288
\pnum
12861289
The locus of a \grammarterm{template-parameter} is immediately after it.
@@ -1341,7 +1344,7 @@
13411344
Each
13421345
\begin{itemize}
13431346
\item
1344-
selection or iteration statement\iref{stmt.select,stmt.iter},
1347+
selection, iteration, or expansion statement\iref{stmt.select,stmt.iter,stmt.expand},
13451348
\item
13461349
substatement of such a statement,
13471350
\item
@@ -4591,7 +4594,7 @@
45914594
\pnum
45924595
\indextext{initializer!temporary and declarator}%
45934596
\indextext{temporary!order of destruction of}%
4594-
There are five contexts in which temporaries are destroyed at a different
4597+
There are several contexts in which temporaries are destroyed at a different
45954598
point than the end of the full-expression.
45964599
The first context is when a default constructor is called to initialize
45974600
an element of an array with no corresponding initializer\iref{dcl.init}.
@@ -4711,14 +4714,25 @@
47114714

47124715
\pnum
47134716
The fourth context is when a temporary object
4714-
is created in the \grammarterm{for-range-initializer} of a range-based \keyword{for} statement.
4717+
is created in the \grammarterm{for-range-initializer} of
4718+
either a range-based \keyword{for} statement
4719+
or an enumerating expansion statement\iref{stmt.expand}.
47154720
If such a temporary object would otherwise be destroyed
47164721
at the end of the \grammarterm{for-range-initializer} full-expression,
47174722
the object persists for the lifetime of the reference
47184723
initialized by the \grammarterm{for-range-initializer}.
47194724

47204725
\pnum
4721-
The fifth context is when a temporary object
4726+
The fifth context is when a temporary object is created
4727+
in the \grammarterm{expansion-initializer}
4728+
of an iterating or destructuring expansion statement.
4729+
If such a temporary object would otherwise be destroyed
4730+
at the end of that \grammarterm{expansion-initializer},
4731+
the object persists for the lifetime of the reference
4732+
initialized by the \grammarterm{expansion-initializer}, if any.
4733+
4734+
\pnum
4735+
The sixth context is when a temporary object
47224736
is created in a structured binding declaration\iref{dcl.struct.bind}.
47234737
Any temporary objects introduced by
47244738
the \grammarterm{initializer}{s} for the variables

source/declarations.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7550,7 +7550,8 @@
75507550
the program is ill-formed.
75517551

75527552
\pnum
7553-
If \tcode{E} is an array type with element type \tcode{T},
7553+
\tcode{E} shall not be an array type of unknown bound.
7554+
If \tcode{E} is any other array type with element type \tcode{T},
75547555
the structured binding size of \tcode{E} is equal to the
75557556
number of elements of \tcode{E}.
75567557
Each $\textrm{SB}_i$ is the name of an

source/preprocessor.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,7 @@
23112311
\defnxname{cpp_deleted_function} & \tcode{202403L} \\ \rowsep
23122312
\defnxname{cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
23132313
\defnxname{cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
2314+
\defnxname{cpp_expansion_statements} & \tcode{202506L} \\ \rowsep
23142315
\defnxname{cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep
23152316
\defnxname{cpp_fold_expressions} & \tcode{201603L} \\ \rowsep
23162317
\defnxname{cpp_generic_lambdas} & \tcode{201707L} \\ \rowsep

0 commit comments

Comments
 (0)