Skip to content

Commit d3fbad1

Browse files
jensmaurertkoeppe
authored andcommitted
[basic.stc.static] Rephrase the definition of 'static storage duration'
This clarifies and centralizes the definition and also avoids the undefined term 'local variable'.
1 parent e9e2acb commit d3fbad1

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

source/basic.tex

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,10 +3696,17 @@
36963696

36973697
\pnum
36983698
\indextext{storage duration!static}%
3699-
All variables which do not have dynamic storage duration, do not have thread
3700-
storage duration, and are not local
3701-
have \defn{static storage duration}. The
3702-
storage for these entities lasts for the duration of the
3699+
All variables which
3700+
\begin{itemize}
3701+
\item
3702+
do not have thread storage duration and
3703+
\item
3704+
belong to a namespace scope\iref{basic.scope.namespace} or
3705+
are first declared with
3706+
the \keyword{static} or \keyword{extern} keywords\iref{dcl.stc}
3707+
\end{itemize}
3708+
have \defn{static storage duration}.
3709+
The storage for these entities lasts for the duration of the
37033710
program~(\ref{basic.start.static}, \ref{basic.start.term}).
37043711

37053712
\pnum
@@ -3709,18 +3716,17 @@
37093716
eliminated as specified in~\ref{class.copy.elision}.
37103717

37113718
\pnum
3719+
\begin{note}
37123720
\indextext{object!local static@local \tcode{static}}%
37133721
The keyword \keyword{static} can be used to declare
3714-
a block variable\iref{basic.scope.block} with static storage duration.
3715-
\begin{note}
3722+
a block variable\iref{basic.scope.block} with static storage duration;
37163723
\ref{stmt.dcl} and \ref{basic.start.term} describe the
37173724
initialization and destruction of such variables.
3718-
\end{note}
3719-
3720-
\pnum
37213725
\indextext{member!class static@class \tcode{static}}%
3722-
The keyword \keyword{static} applied to a class data member in a class
3723-
definition gives the data member static storage duration.
3726+
The keyword \keyword{static} applied to
3727+
a class data member in a class definition
3728+
gives the data member static storage duration\iref{class.static.data}.
3729+
\end{note}
37243730

37253731
\rSec3[basic.stc.thread]{Thread storage duration}
37263732

0 commit comments

Comments
 (0)