Skip to content

Commit 84087b3

Browse files
burblebeezygoloid
authored andcommitted
[std] "must" fixes and suggested rewordings.
Partially addresses ISO/CS 017 (C++20 DIS).
1 parent 710838f commit 84087b3

14 files changed

+51
-64
lines changed

source/basic.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@
25092509
\indextext{lookup!class member}%
25102510
In a class member access expression\iref{expr.ref}, if the \tcode{.}
25112511
or \tcode{->} token is immediately followed by an \grammarterm{identifier}
2512-
followed by a \tcode{<}, the identifier must be looked up to determine
2512+
followed by a \tcode{<}, the identifier is looked up to determine
25132513
whether the \tcode{<} is the beginning of a template argument
25142514
list\iref{temp.names} or a less-than operator. The identifier is first
25152515
looked up in the class of the object expression\iref{class.member.lookup}.
@@ -3615,9 +3615,9 @@
36153615
automatic storage duration, upon exit from the thread for an object with
36163616
thread storage duration, or upon exit from the program for an object
36173617
with static storage duration.}
3618-
the program must ensure that an object of the original type occupies
3618+
and another object of the original type does not occupy
36193619
that same storage location when the implicit destructor call takes
3620-
place; otherwise the behavior of the program is undefined. This is true
3620+
place, the behavior of the program is undefined. This is true
36213621
even if the block is exited with an exception.
36223622
\begin{example}
36233623
\begin{codeblock}
@@ -6157,7 +6157,7 @@
61576157
programs cannot observe most program transformations that do not change
61586158
single-threaded program semantics. In fact, most single-threaded program
61596159
transformations continue to be allowed, since any program that behaves
6160-
differently as a result must perform an undefined operation.
6160+
differently as a result has undefined behavior.
61616161
\end{note}
61626162

61636163
\pnum

source/classes.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,8 +3259,9 @@
32593259

32603260
\pnum
32613261
\begin{note}
3262-
In general, one must use explicit destructor calls and placement
3263-
\grammarterm{new-expression} to change the active member of a union.
3262+
In cases where the above rule does not apply,
3263+
the active member of a union can only be changed by
3264+
the use of a placement \grammarterm{new-expression}.
32643265
\end{note}
32653266
\begin{example}
32663267
Consider an object \tcode{u} of a \tcode{union} type \tcode{U} having non-static data members

source/compatibility.tex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@
20392039

20402040
\diffref{expr.sizeof,expr.cast}
20412041
\change
2042-
Types must be defined in declarations, not in expressions.\\
2042+
In \Cpp{}, types can only be defined in declarations, not in expressions.\\
20432043
In C, a sizeof expression or cast expression may define a new type.
20442044
For example,
20452045
\begin{codeblock}
@@ -2637,8 +2637,6 @@
26372637
\Cpp{} is not identical to ISO C\@.
26382638
Mandating that \mname{STDC}
26392639
be defined would require that translators make an incorrect claim.
2640-
Each implementation must choose the behavior that will be most
2641-
useful to its marketplace.
26422640
\effect
26432641
Change to semantics of well-defined feature.
26442642
\difficulty

source/containers.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,8 +4079,9 @@
40794079
\begin{note}
40804080
Modifying any list requires access to the element preceding the first element
40814081
of interest, but in a \tcode{forward_list} there is no constant-time way to access a
4082-
preceding element. For this reason, ranges that are modified, such as those supplied to
4083-
\tcode{erase} and \tcode{splice}, must be open at the beginning.
4082+
preceding element.
4083+
For this reason, \tcode{erase_after} and \tcode{splice_after}
4084+
take fully-open ranges, not semi-open ranges.
40844085
\end{note}
40854086

40864087
\begin{codeblock}

source/exceptions.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,8 @@
989989

990990
\pnum
991991
\indextext{\idxcode{terminate}}%
992-
In some situations exception handling must be abandoned
992+
% FIXME: What does it mean to abandon exception handling?
993+
In some situations exception handling is abandoned
993994
for less subtle error handling techniques.
994995
\begin{note}
995996
These situations are:

source/expressions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6437,12 +6437,12 @@
64376437
\begin{itemize}
64386438
\item If \tcode{E2} is an lvalue, the target type is
64396439
``lvalue reference to \tcode{T2}'', subject to the
6440-
constraint that in the conversion the reference must bind
6440+
constraint that in the conversion the reference binds
64416441
directly\iref{dcl.init.ref} to a glvalue.
64426442

64436443
\item If \tcode{E2} is an xvalue, the target type is
64446444
``rvalue reference to \tcode{T2}'',
6445-
subject to the constraint that the reference must bind directly.
6445+
subject to the constraint that the reference binds directly.
64466446

64476447
\item If \tcode{E2} is a prvalue or if neither of the conversion sequences above can be
64486448
formed and at least one of the operands has (possibly cv-qualified) class type:
@@ -6617,8 +6617,8 @@
66176617
no new exception object is created.
66186618
The exception is no longer considered to be caught.
66196619
\begin{example}
6620-
Code that must be executed because of an exception, but cannot
6621-
completely handle the exception itself, can be written like this:
6620+
An exception handler that cannot completely handle the exception itself
6621+
can be written like this:
66226622
\begin{codeblock}
66236623
try {
66246624
// ...

source/grammar.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
In particular, the grammar described here accepts
1111
a superset of valid \Cpp{} constructs.
1212
Disambiguation rules~(\ref{stmt.ambig}, \ref{dcl.spec}, \ref{class.member.lookup})
13-
must be applied to distinguish expressions from declarations.
14-
Further, access control, ambiguity, and type rules must be used
13+
are applied to distinguish expressions from declarations.
14+
Further, access control, ambiguity, and type rules are used
1515
to weed out syntactically valid but meaningless constructs.
1616

1717
\rSec1[gram.key]{Keywords}

source/iostreams.tex

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@
465465
\pnum
466466
Concurrent access to a synchronized\iref{ios.members.static} standard iostream object's formatted and unformatted input\iref{istream} and output\iref{ostream} functions or a standard C stream by multiple threads does not result in a data race\iref{intro.multithread}.
467467
\begin{note}
468-
Users must still synchronize concurrent use of these objects and streams by multiple threads if they wish to avoid interleaved characters.
468+
Unsynchronized concurrent use of these objects and streams by multiple threads
469+
can result in interleaved characters.
469470
\end{note}
470471

471472
\xrefc{7.21.2}
@@ -13550,9 +13551,6 @@
1355013551
\tcode{equivalent("foo", "bar")} will be \tcode{true} when both paths resolve to the same file.
1355113552
\end{example}
1355213553
\end{itemize}
13553-
Programmers wishing to determine if two paths are ``the same'' must decide if
13554-
``the same'' means ``the same representation'' or ``resolve to the same actual
13555-
file'', and choose the appropriate function accordingly.
1355613554
\end{note}
1355713555
\end{itemdescr}
1355813556

@@ -14251,8 +14249,7 @@
1425114249
\begin{note}
1425214250
Implementations of \tcode{directory_iterator}\iref{fs.class.directory.iterator}
1425314251
are prohibited from directly or indirectly calling the \tcode{refresh} function
14254-
since it must access the external file system,
14255-
and the objective of caching is to avoid unnecessary file system accesses.
14252+
as described in \ref{fs.class.directory.iterator.general}.
1425614253
\end{note}
1425714254
\end{itemdescr}
1425814255

source/iterators.tex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,6 @@
566566
The library never assumes that past-the-end values are dereferenceable.
567567
Iterators can also have singular values that are not associated with any
568568
sequence.
569-
\begin{example}
570-
After the declaration of an uninitialized pointer \tcode{x}
571-
(as with \tcode{int* x;}),
572-
\tcode{x} must always be assumed to have a singular value of a pointer.
573-
\end{example}
574569
Results of most expressions are undefined for singular values;
575570
the only exceptions are destroying an iterator that holds a singular value,
576571
the assignment of a non-singular value to

source/locales.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,11 +2053,11 @@
20532053
\tcode{ok}.\footnote{Informally, this means that
20542054
\tcode{basic_filebuf}
20552055
assumes that the mappings from internal to external characters is
2056-
1 to N: a
2056+
1 to N: that a
20572057
\tcode{codecvt}
20582058
facet that is used by
20592059
\tcode{basic_filebuf}
2060-
must be able to translate characters one internal character at a time.
2060+
can translate characters one internal character at a time.
20612061
}
20622062
\begin{note}
20632063
As a result of operations on \tcode{state}, it can return \tcode{ok} or \tcode{partial} and set \tcode{from_next == from} and \tcode{to_next != to}.

0 commit comments

Comments
 (0)