Skip to content

Commit 870e89a

Browse files
committed
[std] Rephrase notes containing 'must'
Fixes ISO/CS 037 (C++23 DIS).
1 parent 6388ea5 commit 870e89a

20 files changed

+124
-105
lines changed

source/algorithms.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
another function invocation is specified to synchronize with it,
336336
and if it is not a memory allocation or deallocation function.
337337
\begin{note}
338-
Implementations must ensure that internal synchronization
338+
Implementations are expected to ensure that internal synchronization
339339
inside standard library functions does not prevent forward progress
340340
when those functions are executed by threads of execution
341341
with weakly parallel forward progress guarantees.

source/basic.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@
585585
\end{example}
586586
\begin{note}
587587
The rules for declarations and expressions
588-
describe in which contexts complete class types are required. A class
589-
type \tcode{T} must be complete if:
588+
describe in which contexts complete class types are required.
589+
The program is ill-formed unless a class type \tcode{T} is complete if:
590590
\begin{itemize}
591591
\item an object of type \tcode{T} is defined\iref{basic.def}, or
592592
\item a non-static class data member of type \tcode{T} is
@@ -4207,10 +4207,10 @@
42074207
struct D : virtual B { char c; };
42084208
\end{codeblock}
42094209

4210-
When \tcode{D} is the type of a complete object, it will have a subobject of
4211-
type \tcode{B}, so it must be aligned appropriately for a \tcode{\keyword{long} \keyword{double}}.
4210+
When \tcode{D} is the type of a complete object, it has a subobject of
4211+
type \tcode{B}, so it is aligned appropriately for a \tcode{\keyword{long} \keyword{double}}.
42124212
If \tcode{D} appears as a subobject of another object that also has \tcode{B}
4213-
as a virtual base class, the \tcode{B} subobject might be part of a different
4213+
as a virtual base class, the \tcode{B} subobject can be part of a different
42144214
subobject, reducing the alignment requirements on the \tcode{D} subobject.
42154215
\end{example}
42164216
The result of the \keyword{alignof} operator reflects the alignment
@@ -6368,7 +6368,7 @@
63686368
\begin{note}
63696369
The value observed by a load of an atomic depends on the ``happens
63706370
before'' relation, which depends on the values observed by loads of atomics.
6371-
The intended reading is that there must exist an
6371+
The intended reading is that there exists an
63726372
association of atomic loads with modifications they observe that, together with
63736373
suitably chosen modification orders and the ``happens before'' relation derived
63746374
as described above, satisfy the resulting constraints as imposed here.

source/classes.tex

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,10 @@
435435
class A * A;
436436
\end{codeblock}
437437
first specifies \tcode{A} to be the name of a class and then redefines
438-
it as the name of a pointer to an object of that class. This means that
439-
the elaborated form \keyword{class} \tcode{A} must be used to refer to the
440-
class. Such artistry with names can be confusing and is best avoided.
438+
it as the name of a pointer to an object of that class.
439+
This means references to the class are ill-formed
440+
unless the elaborated form \keyword{class} \tcode{A} is used.
441+
Such artistry with names can be confusing and is best avoided.
441442
\end{note}
442443

443444
\pnum
@@ -2226,7 +2227,7 @@
22262227
\end{codeblock}
22272228
\end{example}
22282229
\begin{note}
2229-
An explicit destructor call must always be written using
2230+
An explicit destructor call is always written using
22302231
a member access operator\iref{expr.ref} or a \grammarterm{qualified-id}\iref{expr.prim.id.qual};
22312232
in particular, the
22322233
\grammarterm{unary-expression}
@@ -3107,9 +3108,10 @@
31073108
default constructor\iref{class.default.ctor},
31083109
copy constructor, move constructor\iref{class.copy.ctor},
31093110
copy assignment operator, move assignment operator\iref{class.copy.assign},
3110-
or destructor\iref{class.dtor}, the corresponding member function
3111-
of the union must be user-provided or it will
3112-
be implicitly deleted\iref{dcl.fct.def.delete} for the union.
3111+
or destructor\iref{class.dtor},
3112+
the corresponding member function of the union
3113+
will be implicitly deleted\iref{dcl.fct.def.delete}
3114+
unless it is user-provided.
31133115
\begin{example}
31143116
Consider the following union:
31153117
\begin{codeblock}
@@ -3123,8 +3125,8 @@
31233125
member functions, \tcode{U} will have an implicitly deleted default constructor,
31243126
copy/move constructor,
31253127
copy/move assignment operator, and destructor.
3126-
To use \tcode{U}, some or all of these member functions
3127-
must be user-provided.
3128+
A use \tcode{U} is ill-formed
3129+
unless some or all of these member functions are user-provided.
31283130
\end{example}
31293131
\end{note}
31303132

@@ -4159,8 +4161,9 @@
41594161
void draw(); // a definition is required somewhere
41604162
};
41614163
\end{codeblock}
4162-
would make class \tcode{circle} non-abstract and a definition of
4163-
\tcode{circle::draw()} must be provided.
4164+
would make class \tcode{circle} non-abstract;
4165+
the program is ill-formed, no diagnostic required,
4166+
unless a definition of \tcode{circle::draw()} is provided\iref{basic.def.odr}.
41644167
\end{example}
41654168

41664169
\pnum
@@ -4349,14 +4352,14 @@
43494352
\tcode{A}.
43504353
This implies, for example, that access checking on the first use of
43514354
\tcode{A::I}
4352-
must be deferred until it is determined that this use of
4355+
is deferred until it is determined that this use of
43534356
\tcode{A::I}
43544357
is as the return type of a member of class
43554358
\tcode{A}.
43564359
Similarly, the use of \tcode{A::B} as a
43574360
\grammarterm{base-specifier} is well-formed because \tcode{D}
43584361
is derived from \tcode{A}, so checking of \grammarterm{base-specifier}{s}
4359-
must be deferred until the entire \grammarterm{base-specifier-list} has been seen.
4362+
is deferred until the entire \grammarterm{base-specifier-list} has been seen.
43604363
\end{example}
43614364

43624365
\pnum

source/compatibility.tex

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,8 +2508,8 @@
25082508
Semantic transformation.
25092509
In \Cpp{}, the initializer for one of a set of
25102510
mutually-referential file-local objects with static storage
2511-
duration must invoke a function
2512-
call to achieve the initialization.
2511+
duration is expected to invoke a function
2512+
to achieve the initialization.
25132513
\howwide
25142514
Seldom.
25152515

@@ -2708,7 +2708,7 @@
27082708
\tcode{sizeof(char*)}
27092709
in C.
27102710
\difficulty
2711-
Programs must add explicit casts to the appropriate rvalue.
2711+
Programs are required to add explicit casts to the appropriate rvalue.
27122712
\howwide
27132713
Rare.
27142714

@@ -2744,7 +2744,7 @@
27442744
return-value mechanisms for the return of class objects.
27452745
If
27462746
some flow paths execute a return without specifying any value,
2747-
the implementation must embody many more complications.
2747+
the implementation gets more complicated.
27482748
Besides,
27492749
promising to return a value of a given type, and then not returning
27502750
such a value, has always been recognized to be a questionable
@@ -2803,7 +2803,7 @@
28032803

28042804
\diffref{dcl.typedef}
28052805
\change
2806-
A \Cpp{} \grammarterm{typedef-name} must be different from any class type name declared
2806+
A \Cpp{} \grammarterm{typedef-name} is required to be different from any class type name declared
28072807
in the same scope (except if the typedef is a synonym of the class name with the
28082808
same name). In C, a \grammarterm{typedef-name} and a struct tag name declared in the same scope
28092809
can have the same name (because they have different name spaces).
@@ -2836,9 +2836,9 @@
28362836

28372837
\diffref{dcl.type} [see also \ref{basic.link}]
28382838
\change
2839-
Const objects must be initialized in \Cpp{} but can be left uninitialized in C.
2839+
Const objects are required to be initialized in \Cpp{} but can be left uninitialized in C.
28402840
\rationale
2841-
A const object cannot be assigned to so it must be initialized
2841+
A const object cannot be assigned to so it is required to be initialized
28422842
to hold a useful value.
28432843
\effect
28442844
Deletion of semantically well-defined feature.
@@ -2888,8 +2888,8 @@
28882888
This feature was marked as ``obsolescent'' in C.
28892889
\difficulty
28902890
Syntactic transformation.
2891-
The function declarations using C incomplete declaration style must
2892-
be completed to become full prototype declarations.
2891+
The function declarations using C incomplete declaration style
2892+
need to be completed to become full prototype declarations.
28932893
A program may need to be updated further if different calls to the
28942894
same (non-prototype) function have different numbers of arguments or
28952895
if the type of corresponding arguments differed.
@@ -2917,7 +2917,7 @@
29172917
Deletion of semantically well-defined feature.
29182918
\difficulty
29192919
Semantic transformation.
2920-
The type definitions must be moved to file scope, or in header files.
2920+
The type definitions need to be moved to file scope, or in header files.
29212921
\howwide
29222922
Seldom.
29232923
This style of type definition is seen as poor coding style.
@@ -2941,7 +2941,7 @@
29412941
compared to the corresponding functionality in C\@.
29422942
In \Cpp{},
29432943
designators for non-static data members
2944-
must be specified in declaration order,
2944+
need to be specified in declaration order,
29452945
designators for array elements and nested designators
29462946
are not supported,
29472947
and
@@ -2960,7 +2960,7 @@
29602960
\rationale
29612961
In \Cpp{}, members are destroyed in reverse construction order
29622962
and the elements of an initializer list are evaluated in lexical order,
2963-
so member initializers must be specified in order.
2963+
so member initializers need to be specified in order.
29642964
Array designators conflict with \grammarterm{lambda-expression} syntax.
29652965
Nested designators are seldom used.
29662966
\effect
@@ -2974,7 +2974,8 @@
29742974
\diffref{dcl.init.string}
29752975
\change
29762976
In \Cpp{}, when initializing an array of character with a string, the number of
2977-
characters in the string (including the terminating \tcode{'\textbackslash 0'}) must not exceed the
2977+
characters in the string (including the terminating \tcode{'\textbackslash 0'})
2978+
is required not to exceed the
29782979
number of elements in the array. In C, an array can be initialized with a string even if
29792980
the array is not large enough to contain the string-terminating \tcode{'\textbackslash 0'}.
29802981

@@ -2989,7 +2990,7 @@
29892990
Deletion of semantically well-defined feature.
29902991
\difficulty
29912992
Semantic transformation.
2992-
The arrays must be declared one element bigger to contain the
2993+
The arrays need to be declared one element bigger to contain the
29932994
string terminating \tcode{'\textbackslash 0'}.
29942995
\howwide
29952996
Seldom.
@@ -3141,7 +3142,7 @@
31413142
\difficulty
31423143
Semantic transformation.
31433144
If volatile semantics are required for the copy,
3144-
a user-declared constructor or assignment must
3145+
a user-declared constructor or assignment needs to
31453146
be provided.
31463147
If non-volatile semantics are required,
31473148
an explicit

source/containers.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,9 @@
594594
All other constructors for these container types take a
595595
\tcode{const allocator_type\&} argument.
596596
\begin{note}
597-
If an invocation of a constructor uses the default value of an optional
598-
allocator argument, then the allocator type must support value-initialization.
597+
Invocation of a constructor that uses the default value of an optional
598+
allocator argument is ill-formed
599+
unless the allocator type supports value-initialization.
599600
\end{note}
600601
A copy of this allocator is used for any memory allocation and element construction
601602
performed, by these constructors and by all member functions,

source/declarations.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332

333333
void g(char c) {
334334
f(0); // OK
335-
f(c); // error on implementations where \tcode{sizeof(int) > 1}: must be \tcode{int}-sized
335+
f(c); // error on implementations where \tcode{sizeof(int) > 1}: \tcode{must be int-sized}
336336
}
337337
\end{codeblock}
338338
\end{example}
@@ -1196,10 +1196,11 @@
11961196
\pnum
11971197
\begin{note}
11981198
Declaring a variable \keyword{const} can affect its linkage\iref{dcl.stc}
1199-
and its usability in constant expressions\iref{expr.const}. As
1200-
described in~\ref{dcl.init}, the definition of an object or subobject
1201-
of const-qualified type must specify an initializer or be subject to
1202-
default-initialization.
1199+
and its usability in constant expressions\iref{expr.const}.
1200+
As described in~\ref{dcl.init},
1201+
the definition of an object or subobject of const-qualified type is ill-formed
1202+
unless the definition specifies an initializer or
1203+
be subject to default-initialization.
12031204
\end{note}
12041205

12051206
\pnum
@@ -3595,10 +3596,9 @@
35953596
printf("a=%d b=%d", a, b);
35963597
\end{codeblock}
35973598

3598-
However, the first argument must be of a type
3599-
that can be converted to a
3600-
\keyword{const}
3601-
\tcode{char*}.
3599+
However, the program is ill-formed
3600+
unless the first argument is of a type
3601+
that can be converted to a \keyword{const} \tcode{char*}.
36023602
\end{example}
36033603
\begin{note}
36043604
The standard header \libheaderref{cstdarg}
@@ -4963,7 +4963,7 @@
49634963
are the first $n$ elements of the aggregate,
49644964
where $n$ is the number of elements in the initializer list.
49654965
\item
4966-
Otherwise, the initializer list must be \tcode{\{\}},
4966+
Otherwise, the initializer list is \tcode{\{\}},
49674967
and there are no explicitly initialized elements.
49684968
\end{itemize}
49694969

0 commit comments

Comments
 (0)