From Jason Turner

[basic.stc.static]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprk4dv3x2/{from.md → to.md} +15 -13
tmp/tmprk4dv3x2/{from.md → to.md} RENAMED
@@ -1,22 +1,24 @@
1
  #### Static storage duration <a id="basic.stc.static">[[basic.stc.static]]</a>
2
 
3
- All variables which do not have dynamic storage duration, do not have
4
- thread storage duration, and are not local have *static storage
5
- duration*. The storage for these entities lasts for the duration of the
6
- program ([[basic.start.static]], [[basic.start.term]]).
 
 
 
 
 
7
 
8
  If a variable with static storage duration has initialization or a
9
  destructor with side effects, it shall not be eliminated even if it
10
  appears to be unused, except that a class object or its copy/move may be
11
  eliminated as specified in  [[class.copy.elision]].
12
 
13
- The keyword `static` can be used to declare a local variable with static
14
- storage duration.
15
-
16
- [*Note 1*: [[stmt.dcl]] describes the initialization of local `static`
17
- variables; [[basic.start.term]] describes the destruction of local
18
- `static` variables. — *end note*]
19
-
20
- The keyword `static` applied to a class data member in a class
21
- definition gives the data member static storage duration.
22
 
 
1
  #### Static storage duration <a id="basic.stc.static">[[basic.stc.static]]</a>
2
 
3
+ All variables which
4
+
5
+ - do not have thread storage duration and
6
+ - belong to a namespace scope [[basic.scope.namespace]] or are first
7
+ declared with the `static` or `extern` keywords [[dcl.stc]]
8
+
9
+ have *static storage duration*. The storage for these entities lasts for
10
+ the duration of the program
11
+ [[basic.start.static]], [[basic.start.term]].
12
 
13
  If a variable with static storage duration has initialization or a
14
  destructor with side effects, it shall not be eliminated even if it
15
  appears to be unused, except that a class object or its copy/move may be
16
  eliminated as specified in  [[class.copy.elision]].
17
 
18
+ [*Note 1*: The keyword `static` can be used to declare a block
19
+ variable [[basic.scope.block]] with static storage duration;
20
+ [[stmt.dcl]] and [[basic.start.term]] describe the initialization and
21
+ destruction of such variables. The keyword `static` applied to a class
22
+ data member in a class definition gives the data member static storage
23
+ duration [[class.static.data]]. — *end note*]
 
 
 
24