Skip to content

Replace the uses of "local variable" with "[block] variable with automatic storage duration" #7307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4296,7 +4296,7 @@

\pnum
\begin{note}
A local variable cannot be odr-used\iref{term.odr.use}
A block variable with automatic storage duration cannot be odr-used\iref{term.odr.use}
in a default argument.
\end{note}
\begin{example}
Expand Down
8 changes: 4 additions & 4 deletions source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
constructed, but not yet destroyed,
since the try block was entered.
If an exception is thrown during the destruction of temporaries or
local variables for a \keyword{return} statement\iref{stmt.return},
variables for a \keyword{return} statement\iref{stmt.return},
the destructor for the returned object (if any) is also invoked.
The objects are destroyed in the reverse order of the completion
of their construction.
Expand All @@ -398,11 +398,11 @@
}
\end{codeblock}
At \#1, the returned object of type \tcode{A} is constructed.
Then, the local variable \tcode{b} is destroyed\iref{stmt.jump}.
Next, the local variable \tcode{y} is destroyed,
Then, the variable \tcode{b} is destroyed\iref{stmt.jump}.
Next, the variable \tcode{y} is destroyed,
causing stack unwinding,
resulting in the destruction of the returned object,
followed by the destruction of the local variable \tcode{a}.
followed by the destruction of the variable \tcode{a}.
Finally, the returned object is constructed again at \#2.
\end{example}

Expand Down
4 changes: 2 additions & 2 deletions source/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@
\end{bnf}

\pnum
\indextext{local variable!destruction of}%
\indextext{block variable with automatic storage duration!destruction of}%
\indextext{scope!destructor and exit from}%
\begin{note}
On exit from a scope (however accomplished), objects with automatic storage
Expand Down Expand Up @@ -946,7 +946,7 @@
The copy-initialization of the result of the call is sequenced before the
destruction of temporaries at the end of the full-expression established
by the operand of the \tcode{return} statement, which, in turn, is sequenced
before the destruction of local variables\iref{stmt.jump} of the block
before the destruction of block variables with automatic storage duration\iref{stmt.jump} of the block
enclosing the \tcode{return} statement.

\pnum
Expand Down
22 changes: 12 additions & 10 deletions source/text.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@

\begin{description}
\stage{1}
The function initializes local variables via
The function initializes variables with automatic storage duration via
\begin{codeblock}
fmtflags flags = str.flags();
fmtflags basefield = (flags & ios_base::basefield);
Expand Down Expand Up @@ -2632,7 +2632,7 @@
\stage{2}
If \tcode{in == end} then stage 2 terminates.
Otherwise a \tcode{charT} is taken from \tcode{in} and
local variables are initialized as if by
variables with automatic storage duration are initialized as if by
\begin{codeblock}
char_type ct = *in;
char c = src[find(atoms, atoms + sizeof(src) - 1, ct) - atoms];
Expand Down Expand Up @@ -2881,7 +2881,8 @@
\effects
Writes characters to the sequence \tcode{out},
formatting \tcode{val} as desired.
In the following description, \tcode{loc} names a local variable initialized as
In the following description, \tcode{loc} names a variable with
automatic storage duration initialized as
\begin{codeblock}
locale loc = str.getloc();
\end{codeblock}
Expand Down Expand Up @@ -2925,7 +2926,8 @@
\begin{description}
\stage{1}
The first action of stage 1 is to determine a conversion specifier.
The tables that describe this determination use the following local variables
The tables that describe this determination use the following variables with
automatic storage duration.

\begin{codeblock}
fmtflags flags = str.flags();
Expand Down Expand Up @@ -3022,7 +3024,7 @@
use_facet<ctype<charT>>(loc).widen(c)
\end{codeblock}

A local variable \tcode{punct} is initialized via
A variable \tcode{punct} with automatic storage duration is initialized via
\begin{codeblock}
const numpunct<charT>& punct = use_facet<numpunct<charT>>(loc);
\end{codeblock}
Expand All @@ -3035,7 +3037,7 @@
Decimal point characters(.) are replaced by \tcode{punct.decimal_point()}.

\stage{3}
A local variable is initialized as
A variable with automatic storage is initialized as
\begin{codeblock}
fmtflags adjustfield = (flags & (ios_base::adjustfield));
\end{codeblock}
Expand Down Expand Up @@ -12398,7 +12400,8 @@
\begin{itemdescr}
\pnum
\effects
Constructs a local variable \tcode{start} of type \tcode{BidirectionalIterator} and
Constructs a variable \tcode{start} of type \tcode{BidirectionalIterator}
with automatic storage duration and
initializes it with the value of \tcode{match[0].second}.

\pnum
Expand Down Expand Up @@ -12743,9 +12746,8 @@
\begin{itemdescr}
\pnum
\effects
Constructs a local variable \tcode{prev} of
type \tcode{position_iterator}, initialized with the value
of \tcode{position}.
Constructs a variable \tcode{prev} of type \tcode{position_iterator}
with automatic storage duration, initialized with the value of \tcode{position}.

\pnum
If \tcode{*this} is a suffix iterator, sets \tcode{*this} to an
Expand Down