Skip to content

[std] Fix cross-references to 'unevaluated operand' #4941

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 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10827,7 +10827,7 @@
\pnum
\constraints
The expression \tcode{::new (declval<void*>()) T(declval<Args>()...)}
is well-formed when treated as an unevaluated operand.
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\effects
Expand Down
4 changes: 2 additions & 2 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@
\end{itemize}

The operand of the \keyword{decltype} specifier is an unevaluated
operand\iref{expr.prop}.
operand\iref{term.unevaluated.operand}.

\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -4157,7 +4157,7 @@
int f(int a, int b = a); // error: parameter \tcode{a} used as default argument
typedef int I;
int g(float I, int b = I(2)); // error: parameter \tcode{I} found
int h(int a, int b = sizeof(a)); // OK, unevaluated operand
int h(int a, int b = sizeof(a)); // OK, unevaluated operand\iref{term.unevaluated.operand}
\end{codeblock}
\end{example}
A non-static member shall not appear in a default argument unless it appears as
Expand Down
21 changes: 11 additions & 10 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
\rSec2[expr.context]{Context dependence}

\pnum
\label{term.unevaluated.operand}%
In some contexts, \defnx{unevaluated operands}{unevaluated operand}
appear~(\ref{expr.prim.req},
\ref{expr.typeid},
Expand Down Expand Up @@ -1384,7 +1385,7 @@
In the declaration of \tcode{p2},
those constraints are required to be satisfied
even though
\tcode{f} is an unevaluated operand\iref{expr.prop}.
\tcode{f} is an unevaluated operand\iref{term.unevaluated.operand}.
\end{example}
\end{note}

Expand Down Expand Up @@ -2694,7 +2695,7 @@
A \grammarterm{requires-expression} is a prvalue of type \tcode{bool}
whose value is described below.
Expressions appearing within a \grammarterm{requirement-body}
are unevaluated operands\iref{expr.prop}.
are unevaluated operands\iref{term.unevaluated.operand}.

\pnum
\begin{example}
Expand Down Expand Up @@ -2781,7 +2782,7 @@
\begin{note}
The enclosing \grammarterm{requires-expression} will evaluate to \keyword{false}
if substitution of template arguments into the \grammarterm{expression} fails.
The \grammarterm{expression} is an unevaluated operand\iref{expr.prop}.
The \grammarterm{expression} is an unevaluated operand\iref{term.unevaluated.operand}.
\end{note}
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -2956,7 +2957,7 @@
\end{example}

\pnum
A local parameter shall only appear as an unevaluated operand\iref{expr.prop}
A local parameter shall only appear as an unevaluated operand\iref{term.unevaluated.operand}
within the \grammarterm{constraint-expression}.
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -3779,7 +3780,7 @@
If the expression is a prvalue,
the temporary materialization conversion\iref{conv.rval}
is applied.
The expression is an unevaluated operand\iref{expr.prop}.
The expression is an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
When \keyword{typeid} is applied to a \grammarterm{type-id}, the result
Expand Down Expand Up @@ -4771,7 +4772,7 @@
The \keyword{sizeof} operator yields the number of bytes
occupied by a non-potentially-overlapping object of the type
of its operand. The operand is either an expression,
which is an unevaluated operand\iref{expr.prop}, or a parenthesized
which is an unevaluated operand\iref{term.unevaluated.operand}, or a parenthesized
\grammarterm{type-id}.
\indextext{type!incomplete}%
The \keyword{sizeof} operator shall not be applied to an expression that
Expand Down Expand Up @@ -4886,7 +4887,7 @@
\indextext{\idxcode{noexcept}}%
\indextext{expression!\idxcode{noexcept}}%
The \keyword{noexcept} operator determines whether the evaluation of its operand,
which is an unevaluated operand\iref{expr.prop}, can throw an
which is an unevaluated operand\iref{term.unevaluated.operand}, can throw an
exception\iref{except.throw}.

\begin{bnf}
Expand Down Expand Up @@ -7010,7 +7011,7 @@
A simple assignment whose left operand is of
a volatile-qualified type is deprecated\iref{depr.volatile.type}
unless the (possibly parenthesized) assignment is a discarded-value expression or
an unevaluated operand.
an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
The behavior of an expression of the form \tcode{E1 \placeholder{op}= E2}
Expand Down Expand Up @@ -7638,7 +7639,7 @@
\end{itemize}
\begin{note}
A manifestly constant-evaluated expression
is evaluated even in an unevaluated operand.
is evaluated even in an unevaluated operand\iref{term.unevaluated.operand}.
\end{note}

\pnum
Expand Down Expand Up @@ -7668,7 +7669,7 @@

\item
a subexpression of one of the above
that is not a subexpression of a nested unevaluated operand.
that is not a subexpression of a nested unevaluated operand\iref{term.unevaluated.operand}.
\end{itemize}

\indextext{function!needed for constant evaluation}%
Expand Down
2 changes: 1 addition & 1 deletion source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@
\pnum
Let \tcode{TS} denote \tcode{tuple_size<T>} of the cv-unqualified type \tcode{T}.
If the expression \tcode{TS::value} is well-formed
when treated as an unevaluated operand,
when treated as an unevaluated operand\iref{term.unevaluated.operand},
then specializations of each of the two templates meet
the \oldconcept{TransformationTrait} requirements with a base characteristic of
\tcode{integral_constant<size_t, TS::value>}.
Expand Down
2 changes: 1 addition & 1 deletion source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5673,7 +5673,7 @@
\pnum
\constraints
The expression \tcode{is >> std::forward<T>(x)} is well-formed
when treated as an unevaluated operand and
when treated as an unevaluated operand\iref{term.unevaluated.operand} and
\tcode{Istream} is publicly and unambiguously derived from \tcode{ios_base}.

\pnum
Expand Down
2 changes: 1 addition & 1 deletion source/threads.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7482,7 +7482,7 @@
\pnum
\constraints
\tcode{\&F::operator()} is well-formed when
treated as an unevaluated operand and
treated as an unevaluated operand\iref{term.unevaluated.operand} and
\tcode{decltype(\brk{}\&F::operator())} is of the form
\tcode{R(G::*)(A...)}~\cv{}~\tcode{\opt{\&}~\opt{noexcept}}
for a class type \tcode{G}.
Expand Down
10 changes: 5 additions & 5 deletions source/time.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@
are valid and each denotes a type\iref{temp.deduct},
\item the expression
\tcode{T::is_steady}
is well-formed when treated as an unevaluated operand,
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand},
\item the expression
\tcode{T::now()}
is well-formed when treated as an unevaluated operand.
Expand Down Expand Up @@ -11023,7 +11023,7 @@
\begin{codeblock}
from_stream(declval<basic_istream<charT, traits>&>(), @$F$@, tp)
\end{codeblock}
is well-formed when treated as an unevaluated operand.
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\returns
Expand Down Expand Up @@ -11056,7 +11056,7 @@
\begin{codeblock}
from_stream(declval<basic_istream<charT, traits>&>(), @$F$@, tp, addressof(abbrev))
\end{codeblock}
is well-formed when treated as an unevaluated operand.
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\returns
Expand Down Expand Up @@ -11093,7 +11093,7 @@
declval<basic_string<charT, traits, Alloc>*>(),
&offset)
\end{codeblock}
is well-formed when treated as an unevaluated operand.
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\returns
Expand Down Expand Up @@ -11133,7 +11133,7 @@
from_stream(declval<basic_istream<charT, traits>&>(),
@$F$@, tp, addressof(abbrev), &offset)
\end{codeblock}
is well-formed when treated as an unevaluated operand.
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\returns
Expand Down
18 changes: 9 additions & 9 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@

\pnum
The library provides the function template \tcode{declval} to simplify the definition of
expressions which occur as unevaluated operands\iref{expr.prop}.
expressions which occur as unevaluated operands\iref{term.unevaluated.operand}.

\indexlibraryglobal{declval}%
\begin{itemdecl}
Expand Down Expand Up @@ -2443,7 +2443,7 @@
\pnum
Let \tcode{TS} denote \tcode{tuple_size<T>} of the cv-unqualified type \tcode{T}.
If the expression \tcode{TS::value} is well-formed
when treated as an unevaluated operand, then
when treated as an unevaluated operand\iref{term.unevaluated.operand}, then
each specialization of the template meets the \oldconcept{Unary\-Type\-Trait} requirements\iref{meta.rqmts}
with a base characteristic of
\begin{codeblock}
Expand Down Expand Up @@ -16133,7 +16133,7 @@
and return type \tcode{R}
if the expression
\tcode{\placeholdernc{INVOKE}<R>(declval<F\&>(), declval<ArgTypes>()...)},
considered as an unevaluated operand\iref{expr.prop}, is
considered as an unevaluated operand\iref{term.unevaluated.operand}, is
well-formed\iref{func.require}.

\pnum
Expand Down Expand Up @@ -18117,7 +18117,7 @@
\tcode{struct is_assignable;} &
The expression \tcode{declval<T>() =} \tcode{declval<U>()} is well-formed
when treated as an unevaluated
operand\iref{expr.prop}. Access checking is performed as if in a context
operand\iref{term.unevaluated.operand}. Access checking is performed as if in a context
unrelated to \tcode{T} and \tcode{U}. Only the validity of the immediate context
of the assignment expression is considered.
\begin{tailnote}
Expand Down Expand Up @@ -18152,7 +18152,7 @@
\tcode{struct is_swappable_with;} &
The expressions \tcode{swap(declval<T>(), declval<U>())} and
\tcode{swap(declval<U>(), declval<T>())} are each well-formed
when treated as an unevaluated operand\iref{expr.prop}
when treated as an unevaluated operand\iref{term.unevaluated.operand}
in an overload-resolution context
for swappable values\iref{swappable.requirements}.
Access checking is performed as if in a context
Expand Down Expand Up @@ -18190,7 +18190,7 @@
for which the expression
\tcode{declval<U\&>().\~U()}
is well-formed
when treated as an unevaluated operand\iref{expr.prop},
when treated as an unevaluated operand\iref{term.unevaluated.operand},
where \tcode{U} is
\tcode{remove_all_extents_t<T>}. &
\tcode{T} shall be a complete type, \cv{}~\keyword{void},
Expand Down Expand Up @@ -18616,7 +18616,7 @@
\tcode{template<class Fn, class... ArgTypes>}\br
\tcode{struct is_invocable;} &
The expression \tcode{\placeholdernc{INVOKE}(declval<Fn>(), declval<ArgTypes>()...)}
is well-formed when treated as an unevaluated operand &
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand} &
\tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes}
shall be complete types, \cv{}~\keyword{void}, or
arrays of unknown bound. \\ \rowsep
Expand Down Expand Up @@ -19080,7 +19080,7 @@
\tcode{struct invoke_result;}
&
If the expression \tcode{\placeholdernc{INVOKE}(declval<Fn>(), declval<ArgTypes>()...)}
is well-formed when treated as an unevaluated operand\iref{expr.prop},
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand},
the member typedef \tcode{type} names the type
\tcode{decltype(\placeholdernc{INVOKE}(declval<Fn>(), declval<ArgTypes>()...))};
otherwise, there shall be no member \tcode{type}. Access checking is
Expand Down Expand Up @@ -22310,7 +22310,7 @@
typename Context::template formatter_type<remove_cvref_t<T>>()
.format(declval<T&>(), declval<Context&>())
\end{codeblock}
shall be well-formed when treated as an unevaluated operand.
shall be well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.

\pnum
\effects
Expand Down