Skip to content

Commit cf064d2

Browse files
committed
[std] Move punctuation to before the footnote marker.
Also add an automated check.
1 parent e0b3fe1 commit cf064d2

File tree

8 files changed

+22
-23
lines changed

8 files changed

+22
-23
lines changed

source/atomics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,12 +641,12 @@
641641

642642
\pnum
643643
\recommended
644-
Operations that are lock-free should also be address-free
644+
Operations that are lock-free should also be address-free.
645645
\begin{footnote}
646646
That is,
647647
atomic operations on the same memory location via two different addresses will
648648
communicate atomically.
649-
\end{footnote}.
649+
\end{footnote}
650650
The implementation of these operations should not depend on any per-process state.
651651
\begin{note}
652652
This restriction enables communication by memory that is

source/basic.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
Appearing inside the brace-enclosed
172172
\grammarterm{declaration-seq} in a \grammarterm{linkage-specification} does
173173
not affect whether a declaration is a definition.
174-
\end{footnote}%
174+
\end{footnote}
175175
\iref{dcl.link}
176176
and neither an \grammarterm{initializer} nor a
177177
\grammarterm{function-body},
@@ -3950,14 +3950,14 @@
39503950
\item
39513951
optionally, a parameter of type \tcode{std::destroying_delete_t}, then
39523952
\item
3953-
optionally, a parameter of type \tcode{std::size_t}
3953+
optionally, a parameter of type \tcode{std::size_t},
39543954
\begin{footnote}
39553955
The global \tcode{operator delete(void*, std::size_t)}
39563956
precludes use of an
39573957
allocation function \tcode{void operator new(std::size_t, std::size_t)} as a placement
39583958
allocation function~(\ref{diff.cpp11.basic}).
3959-
\end{footnote}%
3960-
, then
3959+
\end{footnote}
3960+
then
39613961
\item
39623962
optionally, a parameter of type \tcode{std::align_val_t}.
39633963
\end{itemize}

source/expressions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7054,11 +7054,11 @@
70547054
of $E$;
70557055

70567056
\item
7057-
an invocation of a non-constexpr function
7057+
an invocation of a non-constexpr function;
70587058
\begin{footnote}
70597059
Overload resolution\iref{over.match}
70607060
is applied as usual.
7061-
\end{footnote};
7061+
\end{footnote}
70627062

70637063
\item
70647064
an invocation of an undefined constexpr function;
@@ -7082,13 +7082,13 @@
70827082

70837083
\item
70847084
an operation that would have undefined behavior
7085-
as specified in \ref{intro} through \ref{cpp}
7085+
as specified in \ref{intro} through \ref{cpp};
70867086
\begin{footnote}
70877087
This includes,
70887088
for example, signed integer overflow\iref{expr.prop}, certain
70897089
pointer arithmetic\iref{expr.add}, division by
70907090
zero\iref{expr.mul}, or certain shift operations\iref{expr.shift}.
7091-
\end{footnote};
7091+
\end{footnote}
70927092

70937093
\item
70947094
an lvalue-to-rvalue conversion\iref{conv.lval} unless

source/iostreams.tex

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,7 +2665,7 @@
26652665

26662666
\pnum
26672667
\returns
2668-
\tcode{str}
2668+
\tcode{str}.
26692669
\begin{footnote}
26702670
The function signature
26712671
\tcode{dec(ios_base\&)}
@@ -2676,8 +2676,7 @@
26762676
\tcode{cout << dec}
26772677
to change the format flags stored in
26782678
\tcode{cout}.
2679-
\end{footnote}%
2680-
.
2679+
\end{footnote}
26812680
\end{itemdescr}
26822681

26832682
\indexlibraryglobal{hex}%
@@ -3669,8 +3668,7 @@
36693668
\begin{itemdecl}
36703669
streamsize showmanyc();@
36713670
\begin{footnote}
3672-
\textrm{The morphemes of \tcode{showmanyc}\
3673-
are ``es-how-many-see'', not ``show-manic''.}
3671+
The morphemes of \tcode{showmanyc} are ``es-how-many-see'', not ``show-manic''.
36743672
\end{footnote}@
36753673
\end{itemdecl}
36763674

source/strings.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,8 +4074,7 @@
40744074
using iterator = const_iterator;@
40754075
\begin{footnote}
40764076
Because \tcode{basic_string_view} refers to a constant sequence, \tcode{iterator} and \tcode{const_iterator} are the same type.
4077-
\end{footnote}%
4078-
@
4077+
\end{footnote}@
40794078
using const_reverse_iterator = reverse_iterator<const_iterator>;
40804079
using reverse_iterator = const_reverse_iterator;
40814080
using size_type = size_t;

source/support.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
is required to work as specified even if unary
305305
\tcode{operator\&}
306306
is overloaded for any of the types involved.
307-
\end{footnote}\space
307+
\end{footnote}
308308
The expression \tcode{offsetof(\placeholder{type}, \placeholder{member-designator})}
309309
is never type-dependent\iref{temp.dep.expr} and it is
310310
value-dependent\iref{temp.dep.constexpr} if and only if \tcode{\placeholder{type}} is
@@ -1293,10 +1293,10 @@
12931293
\pnum
12941294
\tcode{denorm_present}
12951295
if the type allows subnormal values
1296-
(variable number of exponent bits)
1296+
(variable number of exponent bits),
12971297
\begin{footnote}
12981298
Required by LIA-1.
1299-
\end{footnote},
1299+
\end{footnote}
13001300
\tcode{denorm_absent}
13011301
if the type does not allow subnormal values,
13021302
and

source/templates.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4349,11 +4349,10 @@
43494349
\begin{itemize}
43504350
\item \grammarterm{simple-declaration} or a \grammarterm{function-definition} in namespace scope,
43514351
\item \grammarterm{member-declaration},
4352-
\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration}
4352+
\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration},
43534353
\begin{footnote}
43544354
This includes friend function declarations.
4355-
\end{footnote}%
4356-
,
4355+
\end{footnote}
43574356
unless that \grammarterm{parameter-declaration} appears in a default argument,
43584357
\item \grammarterm{parameter-declaration} in a \grammarterm{declarator}
43594358
of a function or function template declaration

tools/check.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ for f in $texfiles; do
3232
awk 'prev == $0 && /^\\pnum/ { print FILENAME ":" FNR ": duplicate \\pnum on consecutive lines" } { prev = $0 }' $f
3333
done | grep . && exit 1
3434

35+
# punctuation after the footnote marker
36+
grep -n "\\end{footnote" $texfiles | grep -v '}[@)%]\?$' && exit 1
37+
3538
# \opt used incorrectly.
3639
grep -n '\\opt[^{]' $texfiles && exit 1
3740
grep -n 'opt{}' *.tex && exit 1

0 commit comments

Comments
 (0)