Skip to content

Commit f426cfb

Browse files
jensmaurerzygoloid
authored andcommitted
[std] Remove 'shall' from notes.
Also update the automatic check script to prevent future regressions.
1 parent 1586e4b commit f426cfb

File tree

7 files changed

+24
-16
lines changed

7 files changed

+24
-16
lines changed

source/classes.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,8 +2855,8 @@
28552855

28562856
\pnum
28572857
\begin{note}
2858-
There shall be exactly one definition of a static data member
2859-
that is odr-used\iref{basic.def.odr} in a program; no diagnostic is required.
2858+
There is exactly one definition of a static data member
2859+
that is odr-used\iref{basic.def.odr} in a valid program.
28602860
\end{note}
28612861
Unnamed classes and classes contained directly
28622862
or indirectly within unnamed classes shall not contain static

source/declarations.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5743,7 +5743,7 @@
57435743
corresponding element of the initializer list, and the
57445744
\tcode{std::initializer_list<E>} object is constructed to refer to that array.
57455745
\begin{note}
5746-
A constructor or conversion function selected for the copy shall be
5746+
A constructor or conversion function selected for the copy is required to be
57475747
accessible\iref{class.access} in the context of the initializer list.
57485748
\end{note}
57495749
If a narrowing conversion is required to initialize any of the elements, the program is ill-formed.

source/exceptions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@
796796
non-throwing exception specification,
797797
the function \tcode{std::terminate} is called\iref{except.terminate}.
798798
\begin{note}
799-
An implementation shall not reject an expression merely because, when
799+
An implementation is not permitted to reject an expression merely because, when
800800
executed, it throws or might
801801
throw an exception from a function with a non-throwing exception specification.
802802
\end{note}

source/expressions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@
18461846
if the function call operator template specialization is an immediate function.
18471847
\begin{note}
18481848
This will result in the implicit instantiation of the generic lambda's body.
1849-
The instantiated generic lambda's return type and parameter types shall match
1849+
The instantiated generic lambda's return type and parameter types are required to match
18501850
the return type and parameter types of the pointer to function.
18511851
\end{note}
18521852
\begin{example}
@@ -3347,7 +3347,7 @@
33473347
\tcode{++} is
33483348
a single evaluation.
33493349
\begin{note}
3350-
Therefore, a function call shall not intervene between the
3350+
Therefore, a function call cannot intervene between the
33513351
lvalue-to-rvalue conversion and the side effect associated with any
33523352
single postfix ++ operator.
33533353
\end{note}
@@ -4888,7 +4888,7 @@
48884888
and the deallocation function's name is
48894889
\tcode{operator delete[]}.
48904890
\begin{note}
4891-
An implementation shall provide default definitions for the global
4891+
An implementation is required to provide default definitions for the global
48924892
allocation
48934893
functions~(\ref{basic.stc.dynamic}, \ref{new.delete.single}, \ref{new.delete.array}).
48944894
A \Cpp{} program can provide alternative definitions of
@@ -6668,7 +6668,7 @@
66686668
respect to an indeterminately-sequenced function call, the operation of
66696669
a compound assignment is a single evaluation.
66706670
\begin{note}
6671-
Therefore, a function call shall not intervene between the
6671+
Therefore, a function call cannot intervene between the
66726672
lvalue-to-rvalue conversion and the side effect associated with any
66736673
single compound assignment operator.
66746674
\end{note}

source/iostreams.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,9 @@
867867
as a synonym for a class with equivalent functionality
868868
to class \tcode{ios_base::failure} shown in this subclause.
869869
\begin{note}
870-
When \tcode{ios_base::failure} is a synonym for another type
871-
it shall provide a nested type \tcode{failure},
872-
to emulate the injected class name.
870+
When \tcode{ios_base::failure} is a synonym for another type,
871+
that type is required to provide a nested type \tcode{failure}
872+
to emulate the injected-class-name.
873873
\end{note}
874874
The class
875875
\tcode{failure}

source/templates.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,7 @@
31543154
\tcode{I>}.
31553155
\end{example}
31563156
\begin{note}
3157-
The template argument list shall not be specified in the primary template
3157+
The template argument list cannot be specified in the primary template
31583158
declaration.
31593159
For example,
31603160

@@ -6491,8 +6491,8 @@
64916491

64926492
\pnum
64936493
\begin{note}
6494-
An explicit instantiation of a constrained template
6495-
shall satisfy that template's associated constraints\iref{temp.constr.decl}.
6494+
An explicit instantiation of a constrained template is required
6495+
to satisfy that template's associated constraints\iref{temp.constr.decl}.
64966496
The satisfaction of constraints is determined
64976497
% FIXME: What is a "template name"? Does this mean "simple-template-id"?
64986498
when forming the template name of an explicit instantiation
@@ -6862,8 +6862,8 @@
68626862

68636863
\pnum
68646864
\begin{note}
6865-
An explicit specialization of a constrained template
6866-
shall satisfy that template's associated constraints\iref{temp.constr.decl}.
6865+
An explicit specialization of a constrained template is required
6866+
to satisfy that template's associated constraints\iref{temp.constr.decl}.
68676867
The satisfaction of constraints is determined
68686868
when forming the template name of an explicit specialization
68696869
in which all template arguments are specified\iref{temp.names},

tools/check.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ grep -n "&[ 0-9a-z_]\+) = delete" $texfiles && exit 1
7070
# Bad characters in label. "-" is allowed due to a single remaining offender.
7171
grep -n '^\\rSec.\[[^]]*[^-a-z.0-9][^]]*\]{' $texfiles | sed 's/$/ <--- bad character in label/' | grep . && exit 1
7272

73+
# "shall" inside a note
74+
for f in $texfiles; do
75+
sed -n '/begin{note}/,/end{note}/{/shall[^a-zA-Z]/{=;p}}' $f |
76+
# prefix output with filename and line
77+
sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" |
78+
sed 's/$/ <--- "shall" inside a note/'
79+
done | grep . && exit 1
80+
7381
# \placeholder before (
7482
#egrep 'placeholder{[-A-Za-z]*}@?\(' *.tex
7583
# to fix: sed -i 's/placeholder\({[-A-Za-z]*}@\?(\)/placeholdernc\1/g' *.tex

0 commit comments

Comments
 (0)