Skip to content

Commit

Permalink
[std] Reword "cannot" in notes to not sound like negative permission
Browse files Browse the repository at this point in the history
Notes shall not contain permissions. Even though "cannot" is allowed
to express negative possibility, ISO has requested that we avoid it
when it might be ambiguous and could be mistaken as permission.
  • Loading branch information
tkoeppe committed Jan 12, 2024
1 parent 43fc5a1 commit 966922a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 59 deletions.
6 changes: 3 additions & 3 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@
where \tcode{is_trivially_copy_constructible_v<T>}
and \tcode{is_trivially_destructible_v<T>} are \tcode{true}.
\begin{note}
This implies that user-supplied function objects cannot rely on
object identity of arguments for such input sequences.
This implies that there is no reliable object identity of arguments
in user-supplied function objects for such input sequences.
If object identity of the arguments to these function objects
is important, a wrapping iterator
that returns a non-copied implementation object
Expand Down Expand Up @@ -541,7 +541,7 @@
\tcode{execution::parallel_policy}, or
\tcode{execution::parallel_unsequenced_policy}
allow the implementation to fall back to sequential execution
if the system cannot parallelize an algorithm invocation,
if the system is unable to parallelize an algorithm invocation,
e.g., due to lack of resources.
\end{note}

Expand Down
18 changes: 9 additions & 9 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
The locus of a \grammarterm{concept-definition}
is immediately after its \grammarterm{concept-name}\iref{temp.concept}.
\begin{note}
The \grammarterm{constraint-expression} cannot use
It is not possible for the \grammarterm{constraint-expression} to use
the \grammarterm{concept-name}.
\end{note}

Expand Down Expand Up @@ -1324,7 +1324,7 @@
A \grammarterm{parameter-declaration-clause} $P$ introduces
a \defnadj{function parameter}{scope} that includes $P$.
\begin{note}
A function parameter cannot be used for its value
It is not possible for a function parameter to be used for its value
within the \grammarterm{parameter-declaration-clause}\iref{dcl.fct.default}.
\end{note}
\begin{itemize}
Expand Down Expand Up @@ -4121,7 +4121,7 @@
A destroying operator delete
shall be a class member function named \tcode{\keyword{operator} \keyword{delete}}.
\begin{note}
Array deletion cannot use a destroying operator delete.
It is not possible for array deletion to use a destroying operator delete.
\end{note}

\pnum
Expand Down Expand Up @@ -4773,7 +4773,7 @@
Incompletely-defined object types and \cv{}~\keyword{void} are
\defnadjx{incomplete}{types}{type}\iref{basic.fundamental}.
\begin{note}
Objects cannot be defined to have an incomplete type\iref{basic.def}.
It is not possibe to define objects of incomplete type\iref{basic.def}.
\end{note}

\pnum
Expand All @@ -4793,7 +4793,7 @@
permanently points to or refers to an incomplete type.
An array of unknown bound named by a \keyword{typedef} declaration
permanently refers to an incomplete type.
In either case, the array type cannot be completed.
In either case, it is not possible to complete the array type.
\end{note}
\begin{example}
\indextext{type!example of incomplete}%
Expand Down Expand Up @@ -5007,7 +5007,7 @@
in the object representation are
alternative representations of the value specified by the value representation.
\begin{note}
Padding bits have unspecified value, but cannot cause traps.
Padding bits have unspecified value, but do not cause traps.
In contrast, see ISO C 6.2.6.2.
\end{note}
\begin{note}
Expand Down Expand Up @@ -5892,7 +5892,7 @@
\defn{indeterminately sequenced} when either \placeholder{A} is sequenced before
\placeholder{B} or \placeholder{B} is sequenced before \placeholder{A}, but it is unspecified which.
\begin{note}
Indeterminately sequenced evaluations cannot overlap, but either
Indeterminately sequenced evaluations never overlap, but either
can be executed first.
\end{note}
An expression \placeholder{X}
Expand Down Expand Up @@ -6087,7 +6087,7 @@
side effects on other memory locations to become visible
to other threads that later perform a consume or an acquire operation on
$A$. ``Relaxed'' atomic operations are not synchronization operations even
though, like synchronization operations, they cannot contribute to data races.
though, like synchronization operations, they never contribute to data races.
\end{note}

\pnum
Expand Down Expand Up @@ -6399,7 +6399,7 @@
side effect on that object in that
interleaving. This is normally referred to as ``sequential consistency''.
However, this applies only to data-race-free programs, and data-race-free
programs cannot observe most program transformations that do not change
programs are not able to observe most program transformations that do not change
single-threaded program semantics. In fact, most single-threaded program
transformations remain possible, since any program that behaves
differently as a result has undefined behavior.
Expand Down
48 changes: 22 additions & 26 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@
an abstract class type\iref{class.abstract},
or a (possibly multidimensional) array thereof.
\begin{note}
In particular, a class \tcode{C} cannot contain
In particular, it is not possible for a class \tcode{C} to contain
a non-static member of class \tcode{C},
but it can contain a pointer or reference to an object of class \tcode{C}.
\end{note}
Expand Down Expand Up @@ -1218,7 +1218,7 @@
\indextext{restriction!constructor}%
\begin{note}
A \tcode{return} statement in the body of a constructor
cannot specify a return value\iref{stmt.return}.
never specifies a return value\iref{stmt.return}.
\end{note}

\pnum
Expand Down Expand Up @@ -1425,7 +1425,7 @@
or
\tcode{volatile}
\tcode{X}
cannot initialize an object of type
is not able to initialize an object of type
\cv{}~\tcode{X}.
\begin{example}
\begin{codeblock}
Expand All @@ -1434,7 +1434,7 @@
X(X&); // copy constructor with a non-const parameter
};
const X cx;
X x = cx; // error: \tcode{X::X(X\&)} cannot copy \tcode{cx} into \tcode{x}
X x = cx; // error: \tcode{X::X(X\&)} unable copy \tcode{cx} into \tcode{x}
\end{codeblock}
\end{example}
\end{note}
Expand Down Expand Up @@ -1684,10 +1684,8 @@
\tcode{X}
only has a copy assignment operator with a non-object parameter of type
\tcode{X\&},
an expression of type const
\tcode{X}
cannot be assigned to an object of type
\tcode{X}.
it is not possible to assign an expression of type const \tcode{X}
to an object of type \tcode{X}.
\begin{example}
\begin{codeblock}
struct X {
Expand All @@ -1697,7 +1695,7 @@
const X cx;
X x;
void f() {
x = cx; // error: \tcode{X::operator=(X\&)} cannot assign \tcode{cx} into \tcode{x}
x = cx; // error: \tcode{X::operator=(X\&)} unable to assign \tcode{cx} into \tcode{x}
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -2026,7 +2024,7 @@
\indextext{restriction!destructor}%
\begin{note}
A \tcode{return} statement in the body of a destructor
cannot specify a return value\iref{stmt.return}.
never specifies a return value\iref{stmt.return}.
\end{note}
\indextext{\idxcode{const}!destructor and}%
\indextext{\idxcode{volatile}!destructor and}%
Expand Down Expand Up @@ -2631,7 +2629,7 @@
declarations that appear within the \grammarterm{member-specification} of
the class definition.
\begin{note}
It cannot be specified in member declarations that appear in namespace scope.
It is not possible to specify member declarations that appear in namespace scope with \keyword{static}.
\end{note}

\rSec3[class.static.mfct]{Static member functions}
Expand All @@ -2647,7 +2645,7 @@
\begin{note}
A static member function does not have a \keyword{this}
pointer\iref{expr.prim.this}.
A static member function cannot be qualified with \keyword{const},
It is not possible to qualify a static member function with \keyword{const},
\tcode{volatile}, or \keyword{virtual}\iref{dcl.fct}.
\end{note}

Expand Down Expand Up @@ -3317,11 +3315,9 @@
A class can be declared within a function definition; such a class is
called a \defnadj{local}{class}.
\begin{note}
A declaration in a local class
cannot odr-use\iref{term.odr.use}
a local entity
from an
enclosing scope.
It is not possible for a declaration in a local class
to odr-use\iref{term.odr.use} a local entity
from an enclosing scope.
\end{note}
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -3369,7 +3365,7 @@
\pnum
\indextext{restriction!static member local class}%
\begin{note}
A local class cannot have static data members\iref{class.static.data}.
It is not possible for a local class to have static data members\iref{class.static.data}.
\end{note}

\rSec1[class.derived]{Derived classes}%
Expand Down Expand Up @@ -3541,7 +3537,7 @@
different from the polymorphic behavior of a most derived object of the
same type. A base class subobject can be of zero size;
however, two subobjects that have the same class type and that belong to
the same most derived object cannot be allocated at the same
the same most derived object are never allocated at the same
address\iref{intro.object}.
\end{note}

Expand Down Expand Up @@ -3932,7 +3928,7 @@
\pnum
\begin{note}
The \keyword{virtual} specifier implies membership, so a virtual function
cannot be a non-member\iref{dcl.fct.spec} function. Nor can a virtual
is never a non-member\iref{dcl.fct.spec} function. Nor can a virtual
function be a static member, since a virtual function call relies on a
specific object for determining which function to invoke. A virtual
function declared in one class can be declared a friend\iref{class.friend} in
Expand Down Expand Up @@ -4108,8 +4104,8 @@
\end{codeblock}
\end{example}
\begin{note}
A function declaration cannot provide both a \grammarterm{pure-specifier}
and a definition.
A function declaration can only provide either a \grammarterm{pure-specifier}
or a definition, but not both.
\end{note}
\begin{example}
\begin{codeblock}
Expand All @@ -4121,11 +4117,11 @@

\pnum
\begin{note}
An abstract class type cannot be used
It is not possible to use an abstract class type
as a parameter or return type of
a function being defined\iref{dcl.fct} or called\iref{expr.call},
except as specified in \ref{dcl.type.simple}.
Further, an abstract class type cannot be used as
Further, it is not possible to use an abstract class type as
the type of an explicit type conversion\iref{expr.static.cast,
expr.reinterpret.cast,expr.const.cast},
because the resulting prvalue would be of abstract class type\iref{basic.lval}.
Expand Down Expand Up @@ -6265,8 +6261,8 @@
of constructors and destructors for the object declared by the
\grammarterm{exception-declaration}.
\begin{note}
There cannot be a move from the exception object because it is
always an lvalue.
Since the exception object because is always an lvalue,
it is never moved from, which would potentially be incorrect.
\end{note}
\end{itemize}
Copy elision is not permitted
Expand Down
9 changes: 4 additions & 5 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4320,8 +4320,8 @@
whose category, value type, difference type, and pointer and reference types
are the same as \tcode{X::iterator}'s.
\begin{note}
A \tcode{local_iterator} object can be used to iterate through a single bucket,
but cannot be used to iterate across buckets.
A \tcode{local_iterator} object is usable for iteration through a single bucket,
but not for iteration across buckets.
\end{note}
\end{itemdescr}

Expand All @@ -4337,9 +4337,8 @@
whose category, value type, difference type, and pointer and reference types
are the same as \tcode{X::const_iterator}'s.
\begin{note}
A \tcode{const_local_iterator} object can be used to iterate
through a single bucket,
but cannot be used to iterate across buckets.
A \tcode{const_local_iterator} object is usable for iteration through a single bucket,
but not for iteration across buckets.
\end{note}
\end{itemdescr}

Expand Down
31 changes: 15 additions & 16 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@
with respect to the \keyword{constexpr} or \keyword{consteval} specifier.
\end{note}
\begin{note}
Function parameters cannot be declared \keyword{constexpr}.
It is not possible for a function parameter to be declared \keyword{constexpr}.
\end{note}
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -1020,8 +1020,8 @@
still be respected.
\begin{note}
The \keyword{inline} keyword has no effect on the linkage of a function.
In certain cases, an inline function cannot use names with internal linkage;
see~\ref{basic.link}.
In certain cases, it is not possible for an inline function
to use names with internal linkage; see~\ref{basic.link}.
\end{note}

\pnum
Expand Down Expand Up @@ -1836,7 +1836,7 @@
containing its exported declaration,
outside the \grammarterm{private-module-fragment} (if any).
\begin{note}
The deduced return type cannot have
This avoids having a deduced return type with
a name with internal linkage\iref{basic.link}.
\end{note}

Expand Down Expand Up @@ -3072,12 +3072,12 @@
A reference shall be initialized to refer to a valid object or function.
\begin{note}
\indextext{reference!null}%
In particular, a null reference cannot exist in a well-defined program,
In particular, a well-defined program does not contain null references,
because the only way to create such a reference would be to bind it to
the ``object'' obtained by indirection through a null pointer,
which causes undefined behavior.
As described in~\ref{class.bit}, a reference cannot be bound directly
to a bit-field.
As described in~\ref{class.bit}, it is not possible for a bit-field
to bind directly to a reference.
\end{note}

\pnum
Expand Down Expand Up @@ -4103,8 +4103,8 @@
unless the parameter was expanded from a parameter pack,
or shall be a function parameter pack.
\begin{note}
A default argument
cannot be redefined by a later declaration
It is not possible for a default argument
to be redefined by a later declaration
(not even to the same value)\iref{basic.def.odr}.
\end{note}
\begin{example}
Expand Down Expand Up @@ -4213,8 +4213,8 @@

\pnum
\begin{note}
A local variable cannot be odr-used\iref{term.odr.use}
in a default argument.
It is not possible for a default argument
to odr-use\iref{term.odr.use} a local variable.
\end{note}
\begin{example}
\begin{codeblock}
Expand All @@ -4229,9 +4229,8 @@

\pnum
\begin{note}
The keyword
\keyword{this}
cannot appear in a default argument of a member function;
It is not possible for the keyword \keyword{this}
to appear in a default argument of a member function;
see~\ref{expr.prim.this}.
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -5392,7 +5391,7 @@
\grammarterm{assignment-expression}
is considered for the initialization of the first element of the subaggregate.
\begin{note}
As specified above, brace elision cannot apply to
As specified above, brace elision does not apply to
subaggregates with no elements; an
\grammarterm{initializer-clause} for the entire subobject is needed.
\end{note}
Expand Down Expand Up @@ -8119,7 +8118,7 @@
they do not both declare functions or function templates,
the program is ill-formed.
\begin{note}
Overload resolution possibly cannot distinguish
It is possible that overload resolution is unable to distinguish
between conflicting function declarations.
\end{note}
\begin{example}
Expand Down

0 comments on commit 966922a

Please sign in to comment.