Skip to content

Commit ce78ece

Browse files
jensmaurertkoeppe
authored andcommitted
[std,check] Ensure proper placement of \iref
1 parent 7019fee commit ce78ece

File tree

11 files changed

+37
-31
lines changed

11 files changed

+37
-31
lines changed

source/basic.tex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@
185185
Appearing inside the brace-enclosed
186186
\grammarterm{declaration-seq} in a \grammarterm{linkage-specification} does
187187
not affect whether a declaration is a definition.
188-
\end{footnote}
189-
\iref{dcl.link}
188+
\end{footnote}\iref{dcl.link}
190189
and neither an \grammarterm{initializer} nor a
191190
\grammarterm{function-body},
192191
\item
@@ -2915,8 +2914,8 @@
29152914
they both declare names with external linkage.
29162915
\end{itemize}
29172916
\begin{note}
2918-
There are other circumstances in which declarations declare the same entity%
2919-
\iref{dcl.link,temp.type,temp.spec.partial}.
2917+
There are other circumstances in which declarations declare
2918+
the same entity\iref{dcl.link,temp.type,temp.spec.partial}.
29202919
\end{note}
29212920

29222921
\pnum
@@ -3542,8 +3541,8 @@
35423541
implicitly creates objects in the returned region of storage and
35433542
returns a pointer to a suitable created object.
35443543
\begin{note}
3545-
Some functions in the \Cpp{} standard library implicitly create objects%
3546-
\iref{obj.lifetime,c.malloc,mem.res.public,bit.cast,cstring.syn}.
3544+
Some functions in the \Cpp{} standard library implicitly create
3545+
objects\iref{obj.lifetime,c.malloc,mem.res.public,bit.cast,cstring.syn}.
35473546
\end{note}
35483547
\indextext{object model|)}
35493548

source/classes.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@
15481548
constructor is defined as deleted; otherwise, it is
15491549
defaulted\iref{dcl.fct.def}.
15501550
The latter case is deprecated if the class has a user-declared copy assignment
1551-
operator or a user-declared destructor \iref{depr.impldec}.
1551+
operator or a user-declared destructor\iref{depr.impldec}.
15521552

15531553
\pnum
15541554
The implicitly-declared copy constructor for a class
@@ -1787,7 +1787,7 @@
17871787
assignment operator is defined as deleted; otherwise, it is
17881788
defaulted\iref{dcl.fct.def}.
17891789
The latter case is deprecated if the class has a user-declared copy constructor
1790-
or a user-declared destructor \iref{depr.impldec}.
1790+
or a user-declared destructor\iref{depr.impldec}.
17911791
The implicitly-declared copy assignment operator for a class
17921792
\tcode{X}
17931793
will have the form
@@ -1894,9 +1894,8 @@
18941894
\item a direct non-static data member of class type \tcode{M}
18951895
(or possibly multidimensional array thereof) or
18961896
a direct base class \tcode{M}
1897-
that cannot be copied/moved because overload resolution
1898-
\iref{over.match}, as applied to find \tcode{M}'s corresponding
1899-
assignment operator,
1897+
that cannot be copied/moved because overload resolution\iref{over.match},
1898+
as applied to find \tcode{M}'s corresponding assignment operator,
19001899
either does not result in a usable candidate\iref{over.match.general} or,
19011900
in the case of a variant member, selects a non-trivial function.
19021901
\end{itemize}

source/compatibility.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@
833833
prevent unintended dynamic initialization\iref{dcl.constinit}.
834834
\item
835835
The \keyword{co_await}, \keyword{co_yield}, and \keyword{co_return} keywords are added
836-
to enable the definition of coroutines \iref{dcl.fct.def.coroutine}.
836+
to enable the definition of coroutines\iref{dcl.fct.def.coroutine}.
837837
\item
838838
The \tcode{requires} keyword is added
839839
to introduce constraints through a \grammarterm{requires-clause}\iref{temp.pre}
@@ -3755,7 +3755,7 @@
37553755
\pnum
37563756
Header \libheaderref{cstddef}
37573757
declares the names \tcode{nullptr_t}, \tcode{byte}, and \tcode{to_integer},
3758-
and the operators and operator templates in \iref{support.types.byteops},
3758+
and the operators and operator templates in~\ref{support.types.byteops},
37593759
in addition to the names declared in
37603760
\libheaderrefx{stddef.h}{support.c.headers} in the C standard library.
37613761

source/containers.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21104,7 +21104,7 @@
2110421104

2110521105
The class template \tcode{extents} represents
2110621106
a multidimensional index space of rank equal to \tcode{sizeof...(Extents)}.
21107-
In \iref{views},
21107+
In~\ref{views},
2110821108
\tcode{extents} is used synonymously with multidimensional index space.
2110921109

2111021110
\begin{codeblock}

source/exec.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,7 @@
24032403
then:
24042404
\begin{codeblock}
24052405
completion_signatures<
2406-
@\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@<NewSndr, @\exposid{env-promise}@<Env>>), // \iref{exec.snd.concepts}
2406+
@\exposid{SET-VALUE-SIG}@(@\exposid{await-result-type}@<NewSndr, @\exposid{env-promise}@<Env>>), // \ref{exec.snd.concepts}
24072407
set_error_t(exception_ptr),
24082408
set_stopped_t()>
24092409
\end{codeblock}
@@ -2510,7 +2510,7 @@
25102510
let \tcode{Sigs} name the type
25112511
\begin{codeblock}
25122512
completion_signatures<
2513-
@\exposid{SET-VALUE-SIG}@(V), // see \iref{exec.snd.concepts}
2513+
@\exposid{SET-VALUE-SIG}@(V), // see~\ref{exec.snd.concepts}
25142514
set_error_t(exception_ptr),
25152515
set_stopped_t()>
25162516
\end{codeblock}

source/expressions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5189,7 +5189,7 @@
51895189
an initial await expression,
51905190
or a final await expression\iref{dcl.fct.def.coroutine},
51915191
a search is performed for the name \tcode{await_transform}
5192-
in the scope of \tcode{P} \iref{class.member.lookup}.
5192+
in the scope of \tcode{P}\iref{class.member.lookup}.
51935193
If this search is performed and finds at least one declaration,
51945194
then \placeholder{a} is
51955195
\mbox{\placeholder{p}\tcode{.await_transform(}\grammarterm{cast-expression}\tcode{)}};

source/intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@
790790
\item
791791
a contract assertion\iref{basic.contract.eval}
792792
evaluated with a checking semantic
793-
in a manifestly constant-evaluated context \iref{expr.const}
793+
in a manifestly constant-evaluated context\iref{expr.const}
794794
resulting in a contract violation,
795795
\end{itemize}
796796
a conforming implementation

source/preprocessor.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@
871871
\pnum
872872
\recommended A mechanism similar to, but distinct from, the
873873
\impldef{sequence of places searched for a header}
874-
search paths used for \tcode{\#include} \iref{cpp.include}
874+
search paths used for \tcode{\#include}\iref{cpp.include}
875875
is encouraged.
876876

877877
\pnum
@@ -916,7 +916,7 @@
916916

917917
\pnum
918918
The integer literals in the comma-delimited list correspond to
919-
resource-count consecutive calls to \tcode{std::fgetc} \iref{cstdio.syn}
919+
resource-count consecutive calls to \tcode{std::fgetc}\iref{cstdio.syn}
920920
from the resource, as a binary file.
921921
If any call to \tcode{std::fgetc} returns \tcode{EOF}, the program is
922922
ill-formed.
@@ -995,7 +995,7 @@
995995
one of the two previous forms.
996996
\begin{note}
997997
Adjacent \grammarterm{string-literal}{s} are not concatenated into a single
998-
\grammarterm{string-literal} (see the translation phases in \iref{lex.phases});
998+
\grammarterm{string-literal} (see the translation phases in~\ref{lex.phases});
999999
thus, an expansion that results in two \grammarterm{string-literal}{s} is an
10001000
invalid directive.
10011001
\end{note}

source/templates.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564

565565
\pnum
566566
A \defnadj{default}{template argument} is
567-
a template argument \iref{temp.arg} specified after \tcode{=}
567+
a template argument\iref{temp.arg} specified after \tcode{=}
568568
in a \grammarterm{template-parameter}.
569569
A default template argument may be specified for
570570
any kind of template parameter
@@ -866,7 +866,7 @@
866866

867867
\item
868868
each \grammarterm{template-argument} matches the corresponding
869-
template parameter \iref{temp.arg},
869+
template parameter\iref{temp.arg},
870870

871871
\item
872872
substitution of each template argument into the following
@@ -2108,7 +2108,7 @@
21082108
\end{example}
21092109

21102110
\item
2111-
For a \grammarterm{fold-operator} \tcode{Op} \iref{expr.prim.fold}
2111+
For a \grammarterm{fold-operator} \tcode{Op}\iref{expr.prim.fold}
21122112
that is either \tcode{\&\&} or \tcode{||}:
21132113
\begin{itemize}
21142114
\item

source/threads.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,9 +3693,9 @@
36933693

36943694
\pnum
36953695
For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum
3696-
computation is performed as if by \tcode{max} and \tcode{min} algorithms
3697-
\iref{alg.min.max}, respectively, with the object value and the first
3698-
parameter as the arguments.
3696+
computation is performed as if by \tcode{max} and \tcode{min}
3697+
algorithms\iref{alg.min.max}, respectively,
3698+
with the object value and the first parameter as the arguments.
36993699
\end{itemdescr}
37003700

37013701
\indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}%
@@ -4873,9 +4873,9 @@
48734873

48744874
\pnum
48754875
For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum
4876-
computation is performed as if by \tcode{max} and \tcode{min} algorithms
4877-
\iref{alg.min.max}, respectively, with the object value and the first parameter
4878-
as the arguments.
4876+
computation is performed as if by \tcode{max} and \tcode{min}
4877+
algorithms\iref{alg.min.max}, respectively,
4878+
with the object value and the first parameter as the arguments.
48794879
\end{itemdescr}
48804880

48814881
\indexlibrarymember{operator+=}{atomic<T*>}%
@@ -9671,7 +9671,7 @@
96719671

96729672
\pnum
96739673
\throws
9674-
Timeout-related exceptions \iref{thread.req.timing},
9674+
Timeout-related exceptions\iref{thread.req.timing},
96759675
or any exception thrown by \tcode{pred}.
96769676

96779677
\pnum

tools/check-source.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ grep -n 'unicode{[^}]*[^0-9a-f}][^}]*}' $texfiles |
100100
grep -n '.(\\ref' $texfiles | grep -v -- "--" |
101101
fail 'use \\iref instead of (\\ref' || failed=1
102102

103+
# \iref cannot be at the start of a line
104+
grep -n '^\\iref' $texfiles |
105+
fail '\\iref must be flush against the preceding word, not at the start of a line' || failed=1
106+
107+
# \iref cannot be preceded by space
108+
grep -n ' \\iref' $texfiles |
109+
fail '\\iref must not be preceded by space' || failed=1
110+
103111
# Use \xrefc instead of "ISO C x.y.z"
104112
grep -n "^ISO C [0-9]*\." $texfiles |
105113
fail 'use \\xrefc instead' || failed=1

0 commit comments

Comments
 (0)