Skip to content
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
12 changes: 6 additions & 6 deletions source/declarators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@
\pnum
The optional \grammarterm{requires-clause} (Clause~\ref{temp}) in an
\grammarterm{init-declarator} or \grammarterm{member-declarator}
shall not be present when the declarator does not declare a
shall not be present when the declarator does not declare a
function (\ref{dcl.fct}).
%
When present after a declarator, the \grammarterm{requires-clause}
%
When present after a declarator, the \grammarterm{requires-clause}
is called the \defnx{trailing \grammarterm{requires-clause}{}}{%
trailing requires-clause@trailing \grammarterm{requires-clause}}.
The trailing \grammarterm{requires-clause} introduces the
\grammarterm{constraint-expression} that results from interpreting
its \grammarterm{constraint-logical-or-expression} as a
\grammarterm{constraint-expression}.
%
%
\begin{example}
\begin{codeblock}
void f1(int a) requires true; // OK
auto f2(int a) -> bool requires true; // OK
auto f3(int a) requires true -> bool; // error: \grammarterm{requires-clause} precedes \grammarterm{trailing-return-type}
void (*pf)() requires true; // error: constraint on a variable
void g(int (*)() requires true); // error: constraint on a \grammarterm{parameter-declaration}

auto* p = new void(*)(char) requires true; // error: not a function declaration
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -1430,7 +1430,7 @@
\indextext{type!function}%
A single name can be used for several different functions in a single scope;
this is function overloading (Clause~\ref{over}).
All declarations for a function shall have equivalent return types,
All declarations for a function shall have equivalent return types,
parameter-type-lists, and \grammarterm{requires-clause}{s} (\ref{temp.over.link}).
The type of a function is determined using the following rules.
The type of each parameter (including function parameter packs) is
Expand Down
46 changes: 23 additions & 23 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
\pnum
An \grammarterm{id-expression}
that denotes the specialization of a concept~(\ref{temp.concept})
results in a prvalue of type \tcode{bool}.
results in a prvalue of type \tcode{bool}.
The expression is \tcode{true} if
the concept's normalized~(\ref{temp.constr.decl})
\grammarterm{constraint-expression}
Expand Down Expand Up @@ -1513,7 +1513,7 @@
\indextext{expression!requires|(}%

\pnum
A \grammarterm{requires-expression} provides a concise way to express
A \grammarterm{requires-expression} provides a concise way to express
requirements on template arguments
that can be checked by name lookup~(\ref{basic.lookup})
or by checking properties of types and expressions.
Expand Down Expand Up @@ -1564,37 +1564,37 @@
{*i} -> const typename T::type&;
};
\end{codeblock}
A \grammarterm{requires-expression} can also be used in a
\grammarterm{requires-clause} (Clause~\ref{temp}) as a way of writing ad hoc
A \grammarterm{requires-expression} can also be used in a
\grammarterm{requires-clause} (Clause~\ref{temp}) as a way of writing ad hoc
constraints on template arguments such as the one below:
\begin{codeblock}
template<typename T>
requires requires (T x) { x + x; }
T add(T a, T b) { return a + b; }
\end{codeblock}
The first \tcode{requires} introduces the
The first \tcode{requires} introduces the
\grammarterm{requires-clause}, and the second
introduces the \grammarterm{requires-expression}.
\end{example}

\pnum
A \grammarterm{requires-expression} may introduce local parameters using a
\grammarterm{parameter-declaration-clause}~(\ref{dcl.fct}).
A local parameter of a \grammarterm{requires-expression} shall not have a
\grammarterm{parameter-declaration-clause}~(\ref{dcl.fct}).
A local parameter of a \grammarterm{requires-expression} shall not have a
default argument.
Each name introduced by a local parameter is in scope from the point
of its declaration until the closing brace of the
\grammarterm{requirement-body}.
These parameters have no linkage, storage, or lifetime; they are only used
as notation for the purpose of defining \grammarterm{requirement}{}s.
The \grammarterm{parameter-declaration-clause} of a
The \grammarterm{parameter-declaration-clause} of a
\grammarterm{requirement-parameter-list}
shall not terminate with an ellipsis.
\begin{example}
\begin{codeblock}
template<typename T>
concept C = requires(T t, ...) { // error: terminates with an ellipsis
t;
t;
};
\end{codeblock}
\end{example}
Expand All @@ -1603,12 +1603,12 @@
\indextext{requirement}%
The \grammarterm{requirement-body} contains
a sequence of \grammarterm{requirement}{}s.
These \grammarterm{requirement}{}s may refer to local
parameters, template parameters, and any other declarations visible from the
enclosing context.
These \grammarterm{requirement}{}s may refer to local
parameters, template parameters, and any other declarations visible from the
enclosing context.

\pnum
The substitution of template arguments into a \grammarterm{requires-expression}
The substitution of template arguments into a \grammarterm{requires-expression}
may result in the formation of invalid types or expressions in its
requirements or the violation of the semantic constraints of those requirements.
In such cases, the \grammarterm{requires-expression} evaluates to \tcode{false};
Expand All @@ -1623,8 +1623,8 @@
its requirements, and it does not appear within the declaration of a templated
entity, then the program is ill-formed.
\end{note}
If the substitution of template arguments into a \grammarterm{requirement}
would always result in a substitution failure, the program is ill-formed;
If the substitution of template arguments into a \grammarterm{requirement}
would always result in a substitution failure, the program is ill-formed;
no diagnostic required.
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -1687,12 +1687,12 @@
\end{example}

\pnum
A type requirement that names a class template specialization
A type requirement that names a class template specialization
does not require that type to be complete~(\ref{basic.types}).

\rSec3[expr.prim.req.compound]{Compound requirements}
\indextext{requirement!compound}%

\begin{bnf}
\nontermdef{compound-requirement}\br
\terminal{\{} expression \terminal{\}} \terminal{noexcept}\opt{} return-type-requirement\opt{} \terminal{;}
Expand Down Expand Up @@ -1723,7 +1723,7 @@
\item Substitution of template arguments (if any)
into the \grammarterm{return-type-requirement} is performed.

\item If the \grammarterm{return-type-requirement} is a
\item If the \grammarterm{return-type-requirement} is a
\grammarterm{trailing-return-type},
%%% FIXME: is -> shall be
\tcode{E} is implicitly convertible to
Expand All @@ -1738,7 +1738,7 @@
using the rules in \ref{temp.deduct.call}.
\tcode{F} is a \tcode{void} function template
with a single type template parameter \tcode{T}
declared with the \grammarterm{constrained-parameter}.
declared with the \grammarterm{constrained-parameter}.
A \grammarterm{cv-qualifier-seq} \cv{} is formed
as the union of \tcode{const} and \tcode{volatile} specifiers
around the \grammarterm{constrained-parameter}.
Expand All @@ -1758,7 +1758,7 @@
{x++};
};
\end{codeblock}
The \grammarterm{compound-requirement} in \tcode{C1}
The \grammarterm{compound-requirement} in \tcode{C1}
requires that \tcode{x++} is a valid expression.
It is equivalent to a \grammarterm{simple-requirement}
with the same \grammarterm{expression}.
Expand All @@ -1769,7 +1769,7 @@
};
\end{codeblock}

The \grammarterm{compound-requirement} in \tcode{C2}
The \grammarterm{compound-requirement} in \tcode{C2}
requires that \tcode{*x} is a valid expression,
that \tcode{typename T::inner} is a valid type, and
that \tcode{*x} is implicitly convertible to
Expand Down Expand Up @@ -1801,7 +1801,7 @@
};
\end{codeblock}

The \grammarterm{compound-requirement} in \tcode{C5}
The \grammarterm{compound-requirement} in \tcode{C5}
requires that \tcode{g(x)} is a valid expression and
that \tcode{g(x)} is non-throwing.
\end{example}
Expand Down Expand Up @@ -1835,7 +1835,7 @@
\end{example}

\pnum
A local parameter shall only appear as an unevaluated operand
A local parameter shall only appear as an unevaluated operand
(Clause~\ref{expr}) within the \grammarterm{constraint-expression}.
\begin{example}
\begin{codeblock}
Expand Down
12 changes: 6 additions & 6 deletions source/overloading.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@
\end{itemize}

\pnum
Second, for a function to be viable, if it has associated constraints,
Second, for a function to be viable, if it has associated constraints,
those constraints shall be satisfied (\ref{temp.constr.decl}).

\pnum
Expand Down Expand Up @@ -1691,9 +1691,9 @@
or, if not that,

\item
\tcode{F1} and \tcode{F2} are non-template functions with the same
parameter-type-lists, and \tcode{F1} is more constrained than \tcode{F2}
according to the partial ordering of constraints described in
\tcode{F1} and \tcode{F2} are non-template functions with the same
parameter-type-lists, and \tcode{F1} is more constrained than \tcode{F2}
according to the partial ordering of constraints described in
\ref{temp.constr.order}, or if not that,

\item
Expand Down Expand Up @@ -2883,7 +2883,7 @@
All functions whose
associated constraints are not satisfied~(\ref{temp.constr.decl})
are eliminated from the set of selected functions.
If more than one function in the set remains,
If more than one function in the set remains,
all function template specializations
in the set
are eliminated if the set also contains a function that is not a
Expand All @@ -2892,7 +2892,7 @@
\tcode{F0}
is eliminated if the set contains a second
non-template function that
is more constrained than
is more constrained than
\tcode{F0}
according to
the partial ordering rules of \ref{temp.constr.order}.
Expand Down
8 changes: 4 additions & 4 deletions source/special.tex
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,11 @@
a class member access~(\ref{expr.ref}) using the \tcode{.} operator
where the left operand is one of these expressions and
the right operand designates a non-static data member of non-reference type,
\item
\item
a pointer-to-member operation~(\ref{expr.mptr.oper}) using the \tcode{.*} operator
where the left operand is one of these expressions and
the right operand is a pointer to data member of non-reference type,
\item
\item
a \tcode{const_cast}~(\ref{expr.const.cast}),
\tcode{static_cast}~(\ref{expr.static.cast}),
\tcode{dynamic_cast}~(\ref{expr.dynamic.cast}), or
Expand All @@ -559,10 +559,10 @@
to a glvalue that refers
to the object designated by the operand, or
to its complete object or a subobject thereof,
\item
\item
a conditional expression~(\ref{expr.cond}) that is a glvalue
where the second or third operand is one of these expressions, or
\item
\item
a comma expression~(\ref{expr.comma}) that is a glvalue
where the right operand is one of these expressions.
\end{itemize}
Expand Down
Loading