From fa437b4801b749db196871686327ed60e7774231 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 25 Jun 2025 12:35:16 +0200 Subject: [PATCH 1/2] [std,check] Ensure proper placement of \iref --- source/basic.tex | 11 +++++------ source/classes.tex | 9 ++++----- source/compatibility.tex | 4 ++-- source/containers.tex | 2 +- source/exec.tex | 4 ++-- source/expressions.tex | 2 +- source/intro.tex | 2 +- source/preprocessor.tex | 6 +++--- source/templates.tex | 6 +++--- source/threads.tex | 14 +++++++------- tools/check-source.sh | 8 ++++++++ 11 files changed, 37 insertions(+), 31 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 8178129463..cb38bdda62 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -185,8 +185,7 @@ Appearing inside the brace-enclosed \grammarterm{declaration-seq} in a \grammarterm{linkage-specification} does not affect whether a declaration is a definition. -\end{footnote} -\iref{dcl.link} +\end{footnote}\iref{dcl.link} and neither an \grammarterm{initializer} nor a \grammarterm{function-body}, \item @@ -2915,8 +2914,8 @@ they both declare names with external linkage. \end{itemize} \begin{note} -There are other circumstances in which declarations declare the same entity% -\iref{dcl.link,temp.type,temp.spec.partial}. +There are other circumstances in which declarations declare +the same entity\iref{dcl.link,temp.type,temp.spec.partial}. \end{note} \pnum @@ -3542,8 +3541,8 @@ implicitly creates objects in the returned region of storage and returns a pointer to a suitable created object. \begin{note} -Some functions in the \Cpp{} standard library implicitly create objects% -\iref{obj.lifetime,c.malloc,mem.res.public,bit.cast,cstring.syn}. +Some functions in the \Cpp{} standard library implicitly create +objects\iref{obj.lifetime,c.malloc,mem.res.public,bit.cast,cstring.syn}. \end{note} \indextext{object model|)} diff --git a/source/classes.tex b/source/classes.tex index f0d9a26229..a24602d91a 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1548,7 +1548,7 @@ constructor is defined as deleted; otherwise, it is defaulted\iref{dcl.fct.def}. The latter case is deprecated if the class has a user-declared copy assignment -operator or a user-declared destructor \iref{depr.impldec}. +operator or a user-declared destructor\iref{depr.impldec}. \pnum The implicitly-declared copy constructor for a class @@ -1787,7 +1787,7 @@ assignment operator is defined as deleted; otherwise, it is defaulted\iref{dcl.fct.def}. The latter case is deprecated if the class has a user-declared copy constructor -or a user-declared destructor \iref{depr.impldec}. +or a user-declared destructor\iref{depr.impldec}. The implicitly-declared copy assignment operator for a class \tcode{X} will have the form @@ -1894,9 +1894,8 @@ \item a direct non-static data member of class type \tcode{M} (or possibly multidimensional array thereof) or a direct base class \tcode{M} - that cannot be copied/moved because overload resolution - \iref{over.match}, as applied to find \tcode{M}'s corresponding - assignment operator, + that cannot be copied/moved because overload resolution\iref{over.match}, + as applied to find \tcode{M}'s corresponding assignment operator, either does not result in a usable candidate\iref{over.match.general} or, in the case of a variant member, selects a non-trivial function. \end{itemize} diff --git a/source/compatibility.tex b/source/compatibility.tex index 51910bfffb..8d1468e9cd 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -833,7 +833,7 @@ prevent unintended dynamic initialization\iref{dcl.constinit}. \item The \keyword{co_await}, \keyword{co_yield}, and \keyword{co_return} keywords are added -to enable the definition of coroutines \iref{dcl.fct.def.coroutine}. +to enable the definition of coroutines\iref{dcl.fct.def.coroutine}. \item The \tcode{requires} keyword is added to introduce constraints through a \grammarterm{requires-clause}\iref{temp.pre} @@ -3755,7 +3755,7 @@ \pnum Header \libheaderref{cstddef} declares the names \tcode{nullptr_t}, \tcode{byte}, and \tcode{to_integer}, -and the operators and operator templates in \iref{support.types.byteops}, +and the operators and operator templates in~\ref{support.types.byteops}, in addition to the names declared in \libheaderrefx{stddef.h}{support.c.headers} in the C standard library. diff --git a/source/containers.tex b/source/containers.tex index d7032dfd28..bdde92cf5b 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -21104,7 +21104,7 @@ The class template \tcode{extents} represents a multidimensional index space of rank equal to \tcode{sizeof...(Extents)}. -In \iref{views}, +In~\ref{views}, \tcode{extents} is used synonymously with multidimensional index space. \begin{codeblock} diff --git a/source/exec.tex b/source/exec.tex index 8fa3c30a24..2186f2072c 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -2403,7 +2403,7 @@ then: \begin{codeblock} completion_signatures< - @\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@>), // \iref{exec.snd.concepts} + @\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@>), // \ref{exec.snd.concepts} set_error_t(exception_ptr), set_stopped_t()> \end{codeblock} @@ -2510,7 +2510,7 @@ let \tcode{Sigs} name the type \begin{codeblock} completion_signatures< - @\exposid{SET-VALUE-SIG}@(V), // see \iref{exec.snd.concepts} + @\exposid{SET-VALUE-SIG}@(V), // see~\ref{exec.snd.concepts} set_error_t(exception_ptr), set_stopped_t()> \end{codeblock} diff --git a/source/expressions.tex b/source/expressions.tex index 82baa936f4..8c509d25d6 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5189,7 +5189,7 @@ an initial await expression, or a final await expression\iref{dcl.fct.def.coroutine}, a search is performed for the name \tcode{await_transform} -in the scope of \tcode{P} \iref{class.member.lookup}. +in the scope of \tcode{P}\iref{class.member.lookup}. If this search is performed and finds at least one declaration, then \placeholder{a} is \mbox{\placeholder{p}\tcode{.await_transform(}\grammarterm{cast-expression}\tcode{)}}; diff --git a/source/intro.tex b/source/intro.tex index 1928e84f43..3ac51d8e93 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -790,7 +790,7 @@ \item a contract assertion\iref{basic.contract.eval} evaluated with a checking semantic -in a manifestly constant-evaluated context \iref{expr.const} +in a manifestly constant-evaluated context\iref{expr.const} resulting in a contract violation, \end{itemize} a conforming implementation diff --git a/source/preprocessor.tex b/source/preprocessor.tex index d5f6e0ba7d..24ba1e17be 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -871,7 +871,7 @@ \pnum \recommended A mechanism similar to, but distinct from, the \impldef{sequence of places searched for a header} -search paths used for \tcode{\#include} \iref{cpp.include} +search paths used for \tcode{\#include}\iref{cpp.include} is encouraged. \pnum @@ -916,7 +916,7 @@ \pnum The integer literals in the comma-delimited list correspond to -resource-count consecutive calls to \tcode{std::fgetc} \iref{cstdio.syn} +resource-count consecutive calls to \tcode{std::fgetc}\iref{cstdio.syn} from the resource, as a binary file. If any call to \tcode{std::fgetc} returns \tcode{EOF}, the program is ill-formed. @@ -995,7 +995,7 @@ one of the two previous forms. \begin{note} Adjacent \grammarterm{string-literal}{s} are not concatenated into a single -\grammarterm{string-literal} (see the translation phases in \iref{lex.phases}); +\grammarterm{string-literal} (see the translation phases in~\ref{lex.phases}); thus, an expansion that results in two \grammarterm{string-literal}{s} is an invalid directive. \end{note} diff --git a/source/templates.tex b/source/templates.tex index 7d4eca1376..1b31186058 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -564,7 +564,7 @@ \pnum A \defnadj{default}{template argument} is -a template argument \iref{temp.arg} specified after \tcode{=} +a template argument\iref{temp.arg} specified after \tcode{=} in a \grammarterm{template-parameter}. A default template argument may be specified for any kind of template parameter @@ -866,7 +866,7 @@ \item each \grammarterm{template-argument} matches the corresponding - template parameter \iref{temp.arg}, + template parameter\iref{temp.arg}, \item substitution of each template argument into the following @@ -2108,7 +2108,7 @@ \end{example} \item -For a \grammarterm{fold-operator} \tcode{Op} \iref{expr.prim.fold} +For a \grammarterm{fold-operator} \tcode{Op}\iref{expr.prim.fold} that is either \tcode{\&\&} or \tcode{||}: \begin{itemize} \item diff --git a/source/threads.tex b/source/threads.tex index 1b3e2577fb..d8798e6d59 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3693,9 +3693,9 @@ \pnum For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum -computation is performed as if by \tcode{max} and \tcode{min} algorithms -\iref{alg.min.max}, respectively, with the object value and the first -parameter as the arguments. +computation is performed as if by \tcode{max} and \tcode{min} +algorithms\iref{alg.min.max}, respectively, +with the object value and the first parameter as the arguments. \end{itemdescr} \indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}% @@ -4873,9 +4873,9 @@ \pnum For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum -computation is performed as if by \tcode{max} and \tcode{min} algorithms -\iref{alg.min.max}, respectively, with the object value and the first parameter -as the arguments. +computation is performed as if by \tcode{max} and \tcode{min} +algorithms\iref{alg.min.max}, respectively, +with the object value and the first parameter as the arguments. \end{itemdescr} \indexlibrarymember{operator+=}{atomic}% @@ -9671,7 +9671,7 @@ \pnum \throws -Timeout-related exceptions \iref{thread.req.timing}, +Timeout-related exceptions\iref{thread.req.timing}, or any exception thrown by \tcode{pred}. \pnum diff --git a/tools/check-source.sh b/tools/check-source.sh index 42596cfbb4..1e9d9976ac 100755 --- a/tools/check-source.sh +++ b/tools/check-source.sh @@ -100,6 +100,14 @@ grep -n 'unicode{[^}]*[^0-9a-f}][^}]*}' $texfiles | grep -n '.(\\ref' $texfiles | grep -v -- "--" | fail 'use \\iref instead of (\\ref' || failed=1 +# \iref cannot be at the start of a line +grep -n '^\\iref' $texfiles | + fail '\\iref must be flush against the preceding word, not at the start of a line' || failed=1 + +# \iref cannot be preceded by space +grep -n ' \\iref' $texfiles | + fail '\\iref must not be preceded by space' || failed=1 + # Use \xrefc instead of "ISO C x.y.z" grep -n "^ISO C [0-9]*\." $texfiles | fail 'use \\xrefc instead' || failed=1 From c8c33c72273433abe0502fdd3958dfa7babb1411 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 25 Jun 2025 19:23:47 +0200 Subject: [PATCH 2/2] [check] Add check for spelling of concept names --- tools/check-source.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/check-source.sh b/tools/check-source.sh index 1e9d9976ac..b7be457455 100755 --- a/tools/check-source.sh +++ b/tools/check-source.sh @@ -151,6 +151,9 @@ done | grep -F -ne ') const&' $texlib | fail 'no space between cv-qualifier and ref-qualifier' || failed=1 +grep -n '\\\(def\)\?\(lib\|expos\)concept{[a-z0-9_-]*[^a-z0-9_}-][a-z0-9_-]*}' $texlib | + fail 'bad concept name' || failed=1 + # \begin{example/note} with non-whitespace in front on the same line. grep -ne '^.*[^ ]\s*\\\(begin\|end\){\(example\|note\)}' $texfiles | fail "non-whitespace before note/example begins" || failed=1