Skip to content

Commit 2e25955

Browse files
jensmaurerzygoloid
authored andcommitted
[expr] Add subclauses and adjust cross-references to [expr].
Also move [basic.lval] into [expr].
1 parent 87c88e9 commit 2e25955

File tree

9 files changed

+333
-325
lines changed

9 files changed

+333
-325
lines changed

source/basic.tex

Lines changed: 5 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270

271271
\pnum
272272
An expression is \defn{potentially evaluated} unless it is an
273-
unevaluated operand\iref{expr} or a subexpression thereof.
273+
unevaluated operand\iref{expr.prop} or a subexpression thereof.
274274
The set of \defn{potential results} of an expression \tcode{e} is
275275
defined as follows:
276276
\begin{itemize}
@@ -320,7 +320,7 @@
320320
and, if \tcode{x} is an object, \tcode{ex} is an element of
321321
the set of potential results of an expression \tcode{e}, where either the lvalue-to-rvalue
322322
conversion\iref{conv.lval} is applied to \tcode{e}, or \tcode{e} is
323-
a discarded-value expression\iref{expr}.
323+
a discarded-value expression\iref{expr.prop}.
324324
\tcode{this} is odr-used if it appears as a potentially-evaluated expression
325325
(including as the result of the implicit transformation in the body of a non-static
326326
member function~(\ref{class.mfct.non-static})).
@@ -2529,7 +2529,7 @@
25292529
generates information associated with each such object that makes it
25302530
possible to determine that object's type during program execution. For
25312531
other objects, the interpretation of the values found therein is
2532-
determined by the type of the \grammarterm{expression}{s}\iref{expr}
2532+
determined by the type of the \grammarterm{expression}{s}\iref{expr.compound}
25332533
used to access them.
25342534

25352535
\pnum
@@ -4155,138 +4155,6 @@
41554155
\end{example}%
41564156
\indextext{type|)}
41574157

4158-
\rSec1[basic.lval]{Lvalues and rvalues}
4159-
\pnum
4160-
Expressions are categorized according to the taxonomy in Figure~\ref{fig:categories}.
4161-
4162-
\begin{importgraphic}
4163-
{Expression category taxonomy}
4164-
{fig:categories}
4165-
{valuecategories.pdf}
4166-
\end{importgraphic}
4167-
4168-
\begin{itemize}
4169-
\item A \defn{glvalue} is an expression whose evaluation determines the identity of an object, bit-field, or function.
4170-
\item A \defn{prvalue} is an expression whose evaluation initializes an object or a bit-field,
4171-
or computes the value of the operand of an operator,
4172-
as specified by the context in which it appears.
4173-
\item An \defn{xvalue} is a glvalue that denotes an object or bit-field whose resources can be reused (usually because it is near the end of its lifetime).
4174-
\begin{example}
4175-
Certain kinds of expressions involving rvalue references\iref{dcl.ref} yield xvalues,
4176-
such as a call to a function whose return type is an rvalue reference
4177-
or a cast to an rvalue reference type.
4178-
\end{example}
4179-
\item An \defn{lvalue} is a glvalue that is not an xvalue.
4180-
\item An \defn{rvalue} is a prvalue or an xvalue.
4181-
\end{itemize}
4182-
\begin{note}
4183-
Historically, lvalues and rvalues were so-called
4184-
because they could appear on the left- and right-hand side of an assignment
4185-
(although this is no longer generally true);
4186-
glvalues are ``generalized'' lvalues,
4187-
prvalues are ``pure'' rvalues,
4188-
and xvalues are ``eXpiring'' lvalues.
4189-
Despite their names, these terms classify expressions, not values.
4190-
\end{note}
4191-
Every expression belongs to exactly one of the fundamental classifications in this
4192-
taxonomy: lvalue, xvalue, or prvalue. This property of an expression is called
4193-
its \defn{value category}. \begin{note} The discussion of each built-in operator in
4194-
\ref{expr} indicates the category of the value it yields and the value categories
4195-
of the operands it expects. For example, the built-in assignment operators expect that
4196-
the left operand is an lvalue and that the right operand is a prvalue and yield an
4197-
lvalue as the result. User-defined operators are functions, and the categories of
4198-
values they expect and yield are determined by their parameter and return types. \end{note}
4199-
4200-
\pnum
4201-
The \defnx{result}{result!prvalue} of a prvalue
4202-
is the value that the expression stores into its context.
4203-
A prvalue whose result is the value \placeholder{V}
4204-
is sometimes said to have or name the value \placeholder{V}.
4205-
The \defn{result object} of a prvalue
4206-
is the object initialized by the prvalue;
4207-
a prvalue
4208-
that is used to compute the value of an operand of an operator or
4209-
that has type \cv{}~\tcode{void}
4210-
has no result object.
4211-
\begin{note}
4212-
Except when the prvalue is the operand of a \grammarterm{decltype-specifier},
4213-
a prvalue of class or array type always has a result object.
4214-
For a discarded prvalue, a temporary object is materialized; see \ref{expr}.
4215-
\end{note}
4216-
The \defnx{result}{result!glvalue} of a glvalue is the entity denoted by the expression.
4217-
4218-
\pnum
4219-
\begin{note}
4220-
Whenever a glvalue appears in a context where a prvalue is expected, the glvalue is converted
4221-
to a prvalue; see~\ref{conv.lval}, \ref{conv.array},
4222-
and~\ref{conv.func}.
4223-
An attempt to bind an rvalue reference to an lvalue is not such a context; see~\ref{dcl.init.ref}.
4224-
\end{note}
4225-
\begin{note}
4226-
There are no prvalue bit-fields; if a bit-field is converted to a
4227-
prvalue\iref{conv.lval}, a prvalue of the type of the bit-field is
4228-
created, which might then be promoted\iref{conv.prom}.
4229-
\end{note}
4230-
4231-
\pnum
4232-
\begin{note}
4233-
Whenever a prvalue appears in a context where a glvalue is expected,
4234-
the prvalue is converted to an xvalue; see~\ref{conv.rval}.
4235-
\end{note}
4236-
4237-
\pnum
4238-
The discussion of reference initialization in~\ref{dcl.init.ref} and of
4239-
temporaries in~\ref{class.temporary} indicates the behavior of lvalues
4240-
and rvalues in other significant contexts.
4241-
4242-
\pnum
4243-
Unless otherwise indicated\iref{expr.call},
4244-
a prvalue shall always have complete type or the \tcode{void} type.
4245-
A glvalue shall not have type \cv{}~\tcode{void}.
4246-
\begin{note}
4247-
A glvalue may have complete or incomplete non-\tcode{void} type.
4248-
Class and array prvalues can have cv-qualified types; other prvalues
4249-
always have cv-unqualified types. See \ref{expr}.
4250-
\end{note}
4251-
4252-
\pnum
4253-
An lvalue is \defn{modifiable} unless its type is const-qualified
4254-
or is a function type.
4255-
\begin{note}
4256-
A program that attempts
4257-
to modify an object through a nonmodifiable lvalue expression or through an rvalue expression
4258-
is ill-formed~(\ref{expr.ass}, \ref{expr.post.incr}, \ref{expr.pre.incr}).
4259-
\end{note}
4260-
4261-
\pnum
4262-
If a program attempts to access the stored value of an object through a glvalue
4263-
of other than one of the following types the behavior is
4264-
undefined:\footnote{The intent of this list is to specify those circumstances in which an
4265-
object may or may not be aliased.}
4266-
\begin{itemize}
4267-
\item the dynamic type of the object,
4268-
4269-
\item a cv-qualified version of the dynamic type of the object,
4270-
4271-
\item a type similar (as defined in~\ref{conv.qual}) to the dynamic type
4272-
of the object,
4273-
4274-
\item a type that is the signed or unsigned type corresponding to the
4275-
dynamic type of the object,
4276-
4277-
\item a type that is the signed or unsigned type corresponding to a
4278-
cv-qualified version of the dynamic type of the object,
4279-
4280-
\item an aggregate or union type that includes one of the aforementioned types among its
4281-
elements or non-static data members (including, recursively, an element or non-static data member of a
4282-
subaggregate or contained union),
4283-
4284-
\item a type that is a (possibly cv-qualified) base class type of the dynamic type of
4285-
the object,
4286-
4287-
\item a \tcode{char}, \tcode{unsigned char}, or \tcode{std::byte} type.
4288-
\end{itemize}
4289-
42904158
\rSec1[basic.exec]{Program execution}
42914159

42924160
\rSec2[intro.execution]{Sequential execution}
@@ -4326,7 +4194,7 @@
43264194
The \defnx{immediate subexpressions}{immediate subexpression} of an expression \tcode{e} are
43274195
\begin{itemize}
43284196
\item
4329-
the constituent expressions of \tcode{e}'s operands\iref{expr},
4197+
the constituent expressions of \tcode{e}'s operands\iref{expr.prop},
43304198
\item
43314199
any function call that \tcode{e} implicitly invokes,
43324200
\item
@@ -4356,7 +4224,7 @@
43564224
A \defn{full-expression} is
43574225
\begin{itemize}
43584226
\item
4359-
an unevaluated operand\iref{expr},
4227+
an unevaluated operand\iref{expr.prop},
43604228
\item
43614229
a \grammarterm{constant-expression}\iref{expr.const},
43624230
\item

source/conversions.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
\begin{itemize}
4343
\item When used as operands of operators. The operator's requirements
44-
for its operands dictate the destination type\iref{expr}.
44+
for its operands dictate the destination type\iref{expr.compound}.
4545

4646
\item When used in the condition of an \tcode{if} statement or iteration
4747
statement~(\ref{stmt.select}, \ref{stmt.iter}). The destination type is
@@ -661,6 +661,6 @@
661661
\begin{note}
662662
The integer conversion rank is used in the definition of the integral
663663
promotions\iref{conv.prom} and the usual arithmetic
664-
conversions\iref{expr}.
664+
conversions\iref{expr.prop}.
665665
\end{note}%
666666
\indextext{conversion!standard|)}

source/declarations.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@
13841384
\end{itemize}
13851385

13861386
The operand of the \tcode{decltype} specifier is an unevaluated
1387-
operand\iref{expr}.
1387+
operand\iref{expr.prop}.
13881388

13891389
\begin{example}
13901390
\begin{codeblock}
@@ -4076,7 +4076,7 @@
40764076
calls a function previously declared \tcode{nodiscard}, or
40774077
whose return type is a possibly cv-qualified class or enumeration type
40784078
marked \tcode{nodiscard}. Appearance of a nodiscard call as
4079-
a potentially-evaluated discarded-value expression\iref{expr}
4079+
a potentially-evaluated discarded-value expression\iref{expr.prop}
40804080
is discouraged unless explicitly cast to \tcode{void}.
40814081
Implementations should issue a warning in such cases.
40824082
This is typically because discarding the return value

source/declarators.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,7 +2305,7 @@
23052305
The type of the \grammarterm{id-expression}
23062306
\tcode{e} is called \tcode{E}.
23072307
\begin{note}
2308-
\tcode{E} is never a reference type\iref{expr}.
2308+
\tcode{E} is never a reference type\iref{expr.prop}.
23092309
\end{note}
23102310

23112311
\pnum
@@ -2686,7 +2686,7 @@
26862686
\ref{expr.type.conv}, \ref{expr.static.cast}, \ref{expr.cast}) to an
26872687
unsigned narrow character type
26882688
or \tcode{std::byte} type\iref{cstddef.syn}, or
2689-
\item a discarded-value expression\iref{expr},
2689+
\item a discarded-value expression\iref{expr.prop},
26902690
\end{itemize}
26912691
then the result of the operation is an indeterminate value.
26922692

0 commit comments

Comments
 (0)