Skip to content

Commit 6578410

Browse files
authored
[std] Replace undefined term "automatic object" with "object with automatic storage duration"
Similarly, replace "static object" with "object with static storage duration".
1 parent 1119ab4 commit 6578410

File tree

9 files changed

+29
-40
lines changed

9 files changed

+29
-40
lines changed

source/basic.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6521,7 +6521,6 @@
65216521
Within each of these phases of initiation, initialization occurs as follows.
65226522

65236523
\pnum
6524-
\indextext{initialization!static object@\tcode{static} object}%
65256524
\indextext{initialization!constant}%
65266525
\defnx{Constant initialization}{constant initialization} is performed
65276526
if a variable or temporary object with static or thread storage duration

source/classes.tex

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,7 @@
22822282
\indextext{order of execution!base class destructor}%
22832283
\indextext{order of execution!member destructor}%
22842284
After executing the body of the destructor and destroying
2285-
any automatic objects allocated within the body, a
2285+
any objects with automatic storage duration allocated within the body, a
22862286
destructor for class
22872287
\tcode{X}
22882288
calls the destructors for
@@ -2435,7 +2435,7 @@
24352435
the behavior is undefined if the destructor is invoked
24362436
for an object whose lifetime has ended\iref{basic.life}.
24372437
\begin{example}
2438-
If the destructor for an automatic object is explicitly invoked,
2438+
If the destructor for an object with automatic storage duration is explicitly invoked,
24392439
and the block is subsequently left in a manner that would ordinarily
24402440
invoke implicit destruction of the object, the behavior is undefined.
24412441
\end{example}
@@ -5595,7 +5595,7 @@
55955595

55965596
\pnum
55975597
\begin{note}
5598-
\indextext{order of execution!constructor and \tcode{static} objects}%
5598+
\indextext{order of execution!constructor and static data members}%
55995599
The order in which objects with static or thread storage duration
56005600
are initialized is described in~\ref{basic.start.dynamic} and~\ref{stmt.dcl}.
56015601
\end{note}
@@ -6485,21 +6485,21 @@
64856485
\begin{itemize}
64866486
\item in a \tcode{return} statement in a function with a class return type,
64876487
when the \grammarterm{expression} is the name of a non-volatile
6488-
automatic object (other than a function parameter or a variable
6488+
object with automatic storage duration (other than a function parameter or a variable
64896489
introduced by the \grammarterm{exception-declaration} of a
64906490
\grammarterm{handler}\iref{except.handle})
64916491
with the same type (ignoring cv-qualification) as
64926492
the function return type, the copy/move operation can be
6493-
omitted by constructing the automatic object directly
6493+
omitted by constructing the object directly
64946494
into the function call's return object
64956495

64966496
\item in a \grammarterm{throw-expression}\iref{expr.throw}, when the operand
6497-
is the name of a non-volatile automatic object
6497+
is the name of a non-volatile object with automatic storage duration
64986498
(other than a function or catch-clause parameter)
64996499
whose scope does not extend beyond the end of the innermost enclosing
65006500
\grammarterm{try-block} (if there is one), the copy/move operation from the
65016501
operand to the exception object\iref{except.throw} can be omitted by
6502-
constructing the automatic object directly into the exception object
6502+
constructing the object with automatic storage duration directly into the exception object
65036503

65046504
\item in a coroutine\iref{dcl.fct.def.coroutine}, a copy of a coroutine parameter
65056505
can be omitted and references to that copy replaced with references to the
@@ -6563,23 +6563,15 @@
65636563
A c = g(); // well-formed, \tcode{c.p} may point to \tcode{c} or to an ephemeral temporary
65646564
}
65656565
\end{codeblock}
6566-
Here the criteria for elision can
6567-
eliminate
6568-
the copying of the local automatic object
6569-
\tcode{t}
6570-
into the result object for the function call
6571-
\tcode{f()},
6572-
which is the global object
6573-
\tcode{t2}.
6574-
Effectively, the construction of the local object
6575-
\tcode{t}
6576-
can be viewed as directly initializing the global
6577-
object
6578-
\tcode{t2},
6579-
and that object's destruction will occur at program
6580-
exit.
6566+
Here the criteria for elision can eliminate
6567+
the copying of the object \tcode{t} with automatic storage duration
6568+
into the result object for the function call \tcode{f()},
6569+
which is the global object \tcode{t2}.
6570+
Effectively, the construction of the local object \tcode{t}
6571+
can be viewed as directly initializing the global object \tcode{t2},
6572+
and that object's destruction will occur at program exit.
65816573
Adding a move constructor to \tcode{Thing} has the same effect, but it is the
6582-
move construction from the local automatic object to \tcode{t2} that is elided.
6574+
move construction from the object with automatic storage duration to \tcode{t2} that is elided.
65836575
\end{example}
65846576

65856577
\pnum

source/compatibility.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
\end{codeblock}
113113
is valid in C, invalid in \Cpp{}.
114114
This makes it impossible to define
115-
mutually referential file-local static objects, if initializers are
116-
restricted to the syntactic forms of C\@.
115+
mutually referential file-local objects with static storage duration,
116+
if initializers are restricted to the syntactic forms of C\@.
117117
For example,
118118
\begin{codeblock}
119119
struct X { int i; struct X* next; };
@@ -131,7 +131,8 @@
131131
\difficulty
132132
Semantic transformation.
133133
In \Cpp{}, the initializer for one of a set of
134-
mutually-referential file-local static objects must invoke a function
134+
mutually-referential file-local objects with static storage
135+
duration must invoke a function
135136
call to achieve the initialization.
136137
\howwide
137138
Seldom.

source/declarations.tex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,10 +4104,7 @@
41044104
\pnum
41054105
Except for objects declared with the \tcode{constexpr} specifier, for which see~\ref{dcl.constexpr},
41064106
an \grammarterm{initializer} in the definition of a variable can consist of
4107-
arbitrary
4108-
\indextext{initialization!automatic object}%
4109-
\indextext{initialization!static object@\tcode{static} object}%
4110-
expressions involving literals and previously declared
4107+
arbitrary expressions involving literals and previously declared
41114108
variables and functions,
41124109
regardless of the variable's storage duration.
41134110
\begin{example}
@@ -4135,7 +4132,6 @@
41354132
linkage that has an \grammarterm{initializer} is ill-formed.
41364133

41374134
\pnum
4138-
\indextext{initialization!static object@\tcode{static} object}%
41394135
\indextext{initialization!default}%
41404136
\indextext{variable!indeterminate uninitialized}%
41414137
\indextext{initialization!zero-initialization}%

source/exceptions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@
680680

681681
The lifetime of the variable ends
682682
when the handler exits, after the
683-
destruction of any automatic objects initialized
683+
destruction of any objects with automatic storage duration initialized
684684
within the handler.
685685

686686
\pnum

source/expressions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6983,7 +6983,7 @@
69836983
return [=](auto fvm) { return fvm(m()); };
69846984
};
69856985

6986-
// OK to have captures to automatic objects created during constant expression evaluation.
6986+
// OK to capture objects with automatic storage duration created during constant expression evaluation.
69876987
static_assert(bind(monad(2))(monad)() == monad(2)());
69886988
\end{codeblock}
69896989
\end{example}

source/iostreams.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@
432432
\tcode{ios_base::Init} is constructed, and in any case before the body
433433
of \tcode{main}\iref{basic.start.main} begins execution.\footnote{If it is possible for them to do so, implementations should
434434
initialize the objects earlier than required.}
435-
The objects are not destroyed during program execution.\footnote{Constructors and destructors for static objects can
435+
The objects are not destroyed during program execution.\footnote{Constructors and destructors for objects with
436+
static storage duration can
436437
access these objects to read input from
437438
\tcode{stdin}
438439
or write output to

source/lib-intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3230,7 +3230,7 @@
32303230

32313231
\pnum
32323232
\begin{note}
3233-
This means, for example, that implementations can't use a static object for
3233+
This means, for example, that implementations can't use an object with static storage duration for
32343234
internal purposes without synchronization because it could cause a data race even in
32353235
programs that do not explicitly share objects between threads.
32363236
\end{note}

source/support.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,10 +1885,10 @@
18851885
\tcode{atexit}
18861886
are called.\footnote{A function is called for every time it is registered.}
18871887
See~\ref{basic.start.term} for the order of destructions and calls.
1888-
(Automatic objects are not destroyed as a result of calling
1888+
(Objects with automatic storage duration are not destroyed as a result of calling
18891889
\tcode{exit()}.)\footnote{Objects with automatic storage duration are all destroyed in a program whose
18901890
\tcode{main} function\iref{basic.start.main}
1891-
contains no automatic objects and executes the call to
1891+
contains no objects with automatic storage duration and executes the call to
18921892
\tcode{exit()}.
18931893
Control can be transferred directly to such a
18941894
\tcode{main} function
@@ -5496,8 +5496,8 @@
54965496
has more restricted behavior in this document.
54975497
A \tcode{setjmp}/\tcode{longjmp} call pair has undefined
54985498
behavior if replacing the \tcode{setjmp} and \tcode{longjmp}
5499-
by \tcode{catch} and \tcode{throw} would invoke any non-trivial destructors for any automatic
5500-
objects.
5499+
by \tcode{catch} and \tcode{throw} would invoke any non-trivial destructors for any objects
5500+
with automatic storage duration.
55015501
A call to \tcode{setjmp} or \tcode{longjmp} has undefined
55025502
behavior if invoked in a suspension context of a coroutine\iref{expr.await}.
55035503

0 commit comments

Comments
 (0)