Skip to content

Improve automated checks #8017

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 5 additions & 6 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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|)}

Expand Down
9 changes: 4 additions & 5 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,7 @@
then:
\begin{codeblock}
completion_signatures<
@\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@<NewSndr, @\exposid{env-promise}@<Env>>), // \iref{exec.snd.concepts}
@\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@<NewSndr, @\exposid{env-promise}@<Env>>), // \ref{exec.snd.concepts}
set_error_t(exception_ptr),
set_stopped_t()>
\end{codeblock}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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{)}};
Expand Down
2 changes: 1 addition & 1 deletion source/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions source/preprocessor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions source/threads.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}>}%
Expand Down Expand Up @@ -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<T*>}%
Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions tools/check-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -143,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
Expand Down