Skip to content

Commit 3b4b8d3

Browse files
authored
Move punctuation to before the footnote mark. (#4402)
Also add a programmatic check to catch ill-placed footnote marks in the future.
1 parent c422198 commit 3b4b8d3

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
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: 8 additions & 8 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},
@@ -885,11 +885,11 @@
885885
each declares a function or function template, except when
886886
\begin{itemize}
887887
\item
888-
both declare functions with the same parameter-type-list
888+
both declare functions with the same parameter-type-list,
889889
\begin{footnote}
890890
An implicit object parameter\iref{over.match.funcs}
891891
is not part of the parameter-type-list.
892-
\end{footnote},
892+
\end{footnote}
893893
equivalent\iref{temp.over.link} trailing \grammarterm{requires-clause}s
894894
(if any, except as specified in \ref{temp.friend}), and,
895895
if both are non-static members,
@@ -2220,13 +2220,13 @@
22202220

22212221
\pnum
22222222
In a lookup for a qualified name $N$ whose lookup context is a class $C$
2223-
in which function names are not ignored
2223+
in which function names are not ignored,
22242224
\begin{footnote}
22252225
Lookups in which
22262226
function names are ignored include names appearing in a
22272227
\grammarterm{nested-name-specifier}, an
22282228
\grammarterm{elaborated-type-specifier}, or a \grammarterm{base-specifier}.
2229-
\end{footnote},
2229+
\end{footnote}
22302230
\begin{itemize}
22312231
\item
22322232
if the search finds the injected-class-name of \tcode{C}\iref{class.pre}, or
@@ -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
@@ -7052,11 +7052,11 @@
70527052
of $E$;
70537053

70547054
\item
7055-
an invocation of a non-constexpr function
7055+
an invocation of a non-constexpr function;
70567056
\begin{footnote}
70577057
Overload resolution\iref{over.match}
70587058
is applied as usual.
7059-
\end{footnote};
7059+
\end{footnote}
70607060

70617061
\item
70627062
an invocation of an undefined constexpr function;
@@ -7080,13 +7080,13 @@
70807080

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

70917091
\item
70927092
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/overloading.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
Otherwise,
463463
a contrived object of type
464464
\tcode{T}
465-
becomes the implied object argument
465+
becomes the implied object argument;
466466
\begin{footnote}
467467
An implied object argument is contrived to
468468
correspond to the implicit object
@@ -475,7 +475,7 @@
475475
object parameter, the contrived object will not be the cause to select or
476476
reject a
477477
function.
478-
\end{footnote};
478+
\end{footnote}
479479
if overload resolution selects a non-static member function,
480480
the call is ill-formed.
481481

source/statements.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,11 +894,11 @@
894894
all variables that are active at $P$ and not at $Q$ are destroyed in the reverse order of their construction.
895895
Then, all variables that are active at $Q$ but not at $P$ are initialized in declaration order;
896896
unless all such variables have vacuous initialization\iref{basic.life},
897-
the transfer of control shall not be a jump
897+
the transfer of control shall not be a jump.
898898
\begin{footnote}
899899
The transfer from the condition of a \tcode{switch} statement to a
900900
\tcode{case} label is considered a jump in this respect.
901-
\end{footnote}.
901+
\end{footnote}
902902
When a \grammarterm{declaration-statement} is executed,
903903
$P$ and $Q$ are the points immediately before and after it;
904904
when a function returns, $Q$ is after its body.

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: 5 additions & 5 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
@@ -4926,11 +4925,12 @@
49264925
its lookup context is dependent and is not the current instantiation, or
49274926
\item
49284927
its lookup context is the current instantiation and
4929-
it is \tcode{\keyword{operator}=}
4928+
it is \tcode{\keyword{operator}=},
49304929
\begin{footnote}
49314930
Every instantiation of a class template declares
49324931
a different set of assignment operators.
4933-
\end{footnote}, or
4932+
\end{footnote}
4933+
or
49344934
\item
49354935
its lookup context is the current instantiation and
49364936
has at least one dependent base class, and

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)