diff --git a/src/constraints.tex b/src/constraints.tex index 0de294f..4900dd1 100644 --- a/src/constraints.tex +++ b/src/constraints.tex @@ -936,7 +936,7 @@ This sequence is called the \defn{concept argument list}, and its elements are called \defn{concept argument}{s}. % -For the purpose this matching, a wildcard can match a template +For the purpose of this matching, a wildcard can match a template parameter of any kind (type, non-type, template) as described below. \pnum @@ -995,7 +995,7 @@ \item a template parameter pack (\ref{temp.variadic}), matches zero or more concept arguments, provided that each of those arguments matches the pattern -of the template parameter pack using the rules above for matching matching +of the template parameter pack using the rules above for matching concept arguments and template parameters. \end{itemize} % diff --git a/src/declarations.tex b/src/declarations.tex index 8ca56e4..f8e1e50 100644 --- a/src/declarations.tex +++ b/src/declarations.tex @@ -155,9 +155,9 @@ (\ref{expr.prim.req.compound}) introduces an argument deduction constraint (\ref{temp.constr.deduct}). % -The \tcode{auto} \grammarterm{type-specifier} is also introduce a function type -having a \grammarterm{trailing-return-type} or to introduce a structured binding -declaration \cxxref{dcl.struct.bind}. +The \tcode{auto} \grammarterm{type-specifier} is also used to introduce a +function type having a \grammarterm{trailing-return-type} or to introduce +a structured binding declaration \cxxref{dcl.struct.bind}. % \enternote A \grammarterm{nested-name-specifier} can also include placeholders (\ref{expr.prim}). @@ -183,8 +183,8 @@ return type of the function. Otherwise, the function declarator shall declare a function. % -If the declared return type of the function contains a placeholder, the -return type of the function is deduced from non-discarded return statements, +If the declared return type of the function contains a placeholder\removed{ type}, +the return type of the function is deduced from non-discarded return statements, if any, in the body of the function (\ref{stmt.if}). % \added{ @@ -314,7 +314,7 @@ \removed{\tcode{auto} or \tcode{decltype(auto)}} is deduced from its initializer. % -This use is allowed in an initializing declaration (\cxxref{11.6}) of a variable. +This use is allowed in an initializing declaration (\cxxref{dcl.init}) of a variable. % \removed{\tcode{auto} or \tcode{decltype(auto)} shall appear as one of the \grammarterm{decl-specifier}{}s in the \grammarterm{decl-specifier-seq} } @@ -395,7 +395,7 @@ \pnum If the \grammarterm{init-declarator-list} contains more than one \grammarterm{init-declarator}, they shall all form declarations of variables. -The type of each declared variable is determined is determined by placeholder +The type of each declared variable is determined by placeholder type deduction (\ref{dcl.spec.auto.deduct}), and if the type that replaces \removed{the placeholder type} \added{the declared variable type or return type} @@ -520,7 +520,7 @@ \removed{a deduced type} \added{deduced values (type, non-type, template)}. \pnum -A type \tcode{T} containing a \removed{placeholder type}\added{placeholders}, +A type \tcode{T} containing \removed{a placeholder type}\added{placeholders}, and a corresponding initializer \tcode{e}, are determined as follows: @@ -561,6 +561,7 @@ % \tcode{T} shall be either \tcode{decltype(auto)}, \tcode{auto}, or a % \grammarterm{constrained-type-specifier}.} +\setcounter{Paras}{3} \pnum If the placeholder is the \tcode{auto} \grammarterm{type-specifier} \added{or a \grammarterm{constrained-type-specifier}}, the deduced type @@ -570,14 +571,14 @@ \removed{Obtain \tcode{P} from \tcode{T} by replacing the occurrences of \tcode{auto} with either a new invented type template parameter \tcode{U} or, -if the initialization is copy-list-initialization, with +if the initialization is \grammarterm{copy-list-initialization}, with \tcode{std::initializer_list}.} % \begin{addedblock} -Otherwise, obtain a type \tcode{P} from \tcode{T} as follows: +Obtain a type \tcode{P} from \tcode{T} as follows: \begin{itemize} % FIXME: This doesn't do the right thing at all. -\item if the initialization is a copy-list-initialization +\item if the initialization is a \grammarterm{copy-list-initialization} and a placeholder is a \grammarterm{decl-specifier} of the \grammarterm{decl-specifier-seq} of the variable declaration, replace that occurrence of the placeholder with \tcode{std::initializer_list} @@ -605,7 +606,7 @@ \grammarterm{constraint-expression} as follows:} \begin{addedblock} \begin{itemize} -\item if there is single \grammarterm{constrained-type-specifier}, +\item if there is a single \grammarterm{constrained-type-specifier}, then \tcode{C} is the \grammarterm{constraint-expression} introduced by the invented template \grammarterm{constrained-parameter} (\ref{temp.param}) corresponding to that \grammarterm{constrained-type-specifier}; @@ -713,7 +714,7 @@ The return type of \tcode{cf} is deduced from the parameter \tcode{p2} in the call \tcode{f2(expr)} of the following invented function: \begin{codeblock} -template void f2(Pair); +template void f2(Pair p2); \end{codeblock} Both \grammarterm{constrained-type-specifier}{}s in the return type of \tcode{cf} correspond to the same invented template parameter. @@ -762,7 +763,6 @@ template class Array { }; template class A> class Stack { }; -template class Alloc { }; void f1(C1); // \tcode{C1} designates a placeholder type void f2(Array); // \tcode{C2} designates a placeholder for an integer value