Skip to content

Commit 854c1a3

Browse files
committed
[std] Move punctuation to before the footnote marker.
Also add an automated check.
1 parent 9417d36 commit 854c1a3

File tree

10 files changed

+27
-28
lines changed

10 files changed

+27
-28
lines changed

source/atomics.tex

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

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

source/basic.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
Appearing inside the brace-enclosed
135135
\grammarterm{declaration-seq} in a \grammarterm{linkage-specification} does
136136
not affect whether a declaration is a definition.
137-
\end{footnote}%
137+
\end{footnote}
138138
\iref{dcl.link}
139139
and neither an \grammarterm{initializer} nor a
140140
\grammarterm{function-body},
@@ -1616,15 +1616,15 @@
16161616
in a complete-class context\iref{class.mem} of \tcode{X} or
16171617
in the definition of a class member outside of the definition of \tcode{X},
16181618
following the member's
1619-
\grammarterm{declarator-id}
1619+
\grammarterm{declarator-id},
16201620
\begin{footnote}
16211621
That is, an unqualified name that occurs,
16221622
for instance, in a
16231623
type in the
16241624
\grammarterm{parameter-declaration-clause} or in the
16251625
\grammarterm{noexcept-specifier}.
1626-
\end{footnote}%
1627-
, shall be declared in one of the
1626+
\end{footnote}
1627+
shall be declared in one of the
16281628
following ways:
16291629
\begin{itemize}
16301630
\item before its use in the block in which it is used or in an enclosing
@@ -4109,14 +4109,14 @@
41094109
\item
41104110
optionally, a parameter of type \tcode{std::destroying_delete_t}, then
41114111
\item
4112-
optionally, a parameter of type \tcode{std::size_t}
4112+
optionally, a parameter of type \tcode{std::size_t},
41134113
\begin{footnote}
41144114
The global \tcode{operator delete(void*, std::size_t)}
41154115
precludes use of an
41164116
allocation function \tcode{void operator new(std::size_t, std::size_t)} as a placement
41174117
allocation function~(\ref{diff.cpp11.basic}).
4118-
\end{footnote}%
4119-
, then
4118+
\end{footnote}
4119+
then
41204120
\item
41214121
optionally, a parameter of type \tcode{std::align_val_t}.
41224122
\end{itemize}

source/expressions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6985,11 +6985,11 @@
69856985
of $E$;
69866986

69876987
\item
6988-
an invocation of a non-constexpr function
6988+
an invocation of a non-constexpr function;
69896989
\begin{footnote}
69906990
Overload resolution\iref{over.match}
69916991
is applied as usual.
6992-
\end{footnote};
6992+
\end{footnote}
69936993

69946994
\item
69956995
an invocation of an undefined constexpr function;
@@ -7013,13 +7013,13 @@
70137013

70147014
\item
70157015
an operation that would have undefined behavior
7016-
as specified in \ref{intro} through \ref{cpp}
7016+
as specified in \ref{intro} through \ref{cpp};
70177017
\begin{footnote}
70187018
This includes,
70197019
for example, signed integer overflow\iref{expr.prop}, certain
70207020
pointer arithmetic\iref{expr.add}, division by
70217021
zero\iref{expr.mul}, or certain shift operations\iref{expr.shift}.
7022-
\end{footnote};
7022+
\end{footnote}
70237023

70247024
\item
70257025
an lvalue-to-rvalue conversion\iref{conv.lval} unless

source/intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
the Institute of Electrical and Electronic Engineers, Inc.
4545
This information is given for the convenience of users of this document and
4646
does not constitute an endorsement by ISO or IEC of this product.
47-
\end{footnote}%
47+
\end{footnote}
4848
)}
4949
\item ISO/IEC 10646, \doccite{Information technology ---
5050
Universal Coded Character Set (UCS)}

source/iostreams.tex

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

26652665
\pnum
26662666
\returns
2667-
\tcode{str}
2667+
\tcode{str}.
26682668
\begin{footnote}
26692669
The function signature
26702670
\tcode{dec(ios_base\&)}
@@ -2675,8 +2675,7 @@
26752675
\tcode{cout << dec}
26762676
to change the format flags stored in
26772677
\tcode{cout}.
2678-
\end{footnote}%
2679-
.
2678+
\end{footnote}
26802679
\end{itemdescr}
26812680

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

source/strings.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,8 +4052,7 @@
40524052
using iterator = const_iterator;@
40534053
\begin{footnote}
40544054
Because \tcode{basic_string_view} refers to a constant sequence, \tcode{iterator} and \tcode{const_iterator} are the same type.
4055-
\end{footnote}%
4056-
@
4055+
\end{footnote}@
40574056
using const_reverse_iterator = reverse_iterator<const_iterator>;
40584057
using reverse_iterator = const_reverse_iterator;
40594058
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
@@ -1289,10 +1289,10 @@
12891289
\pnum
12901290
\tcode{denorm_present}
12911291
if the type allows subnormal values
1292-
(variable number of exponent bits)
1292+
(variable number of exponent bits),
12931293
\begin{footnote}
12941294
Required by LIA-1.
1295-
\end{footnote},
1295+
\end{footnote}
12961296
\tcode{denorm_absent}
12971297
if the type does not allow subnormal values,
12981298
and

source/templates.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4400,11 +4400,10 @@
44004400
\begin{itemize}
44014401
\item \grammarterm{simple-declaration} or a \grammarterm{function-definition} in namespace scope,
44024402
\item \grammarterm{member-declaration},
4403-
\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration}
4403+
\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration},
44044404
\begin{footnote}
44054405
This includes friend function declarations.
4406-
\end{footnote}%
4407-
,
4406+
\end{footnote}
44084407
unless that \grammarterm{parameter-declaration} appears in a default argument,
44094408
\item \grammarterm{parameter-declaration} in a \grammarterm{declarator}
44104409
of a function or function template declaration

source/utilities.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19598,7 +19598,7 @@
1959819598
Windows\textregistered\ is a registered trademark of Microsoft Corporation.
1959919599
This information is given for the convenience of users of this document and
1960019600
does not constitute an endorsement by ISO or IEC of this product.
19601-
\end{footnote}%
19601+
\end{footnote}
1960219602
-based and
1960319603
many POSIX-based operating systems.
1960419604
\end{note}

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)