|
6374 | 6374 | variable template specialization has ordered initialization.
|
6375 | 6375 | \end{note}
|
6376 | 6376 |
|
| 6377 | +\pnum |
| 6378 | +A declaration \tcode{D} is |
| 6379 | +\defn{appearance-ordered} before a declaration \tcode{E} if |
| 6380 | +\begin{itemize} |
| 6381 | +\item \tcode{D} appears in the same translation unit as \tcode{E}, or |
| 6382 | +\item the translation unit containing \tcode{E} |
| 6383 | +has an interface dependency on the translation unit containing \tcode{D}, |
| 6384 | +\end{itemize} |
| 6385 | +in either case prior to \tcode{E}. |
| 6386 | + |
6377 | 6387 | \pnum
|
6378 | 6388 | Dynamic initialization of non-local variables \tcode{V} and \tcode{W}
|
6379 | 6389 | with static storage duration are ordered as follows:
|
6380 | 6390 | \begin{itemize}
|
6381 | 6391 | \item
|
6382 |
| -If \tcode{V} and \tcode{W} have |
6383 |
| -ordered initialization and \tcode{V} is defined before \tcode{W} within |
6384 |
| -a single translation unit, the initialization of \tcode{V} is sequenced |
6385 |
| -before the initialization of \tcode{W}. |
6386 |
| - |
6387 |
| -\item |
6388 |
| -If \tcode{V} has partially-ordered initialization, \tcode{W} does not have |
6389 |
| -unordered initialization, and \tcode{V} is defined before \tcode{W} in |
6390 |
| -every translation unit in which \tcode{W} is defined, then |
| 6392 | +If \tcode{V} and \tcode{W} have ordered initialization and |
| 6393 | +the definition of \tcode{V} |
| 6394 | +is appearance-ordered before the definition of \tcode{W}, or |
| 6395 | +if \tcode{V} has partially-ordered initialization, |
| 6396 | +\tcode{W} does not have unordered initialization, and |
| 6397 | +for every definition \tcode{E} of \tcode{W} |
| 6398 | +there exists a definition \tcode{D} of \tcode{V} |
| 6399 | +such that \tcode{D} is appearance-ordered before \tcode{E}, then |
6391 | 6400 | \begin{itemize}
|
6392 | 6401 | \item
|
6393 |
| -if the program starts a thread\iref{intro.multithread} |
6394 |
| -other than the main thread\iref{basic.start.main}, |
| 6402 | +if the program does not start a thread\iref{intro.multithread} |
| 6403 | +other than the main thread\iref{basic.start.main} |
| 6404 | +or \tcode{V} and \tcode{W} have ordered initialization and |
| 6405 | +they are defined in the same translation unit, |
6395 | 6406 | the initialization of \tcode{V}
|
6396 |
| -strongly happens before |
| 6407 | +is sequenced before |
6397 | 6408 | the initialization of \tcode{W};
|
6398 | 6409 | \item
|
6399 | 6410 | otherwise,
|
6400 | 6411 | the initialization of \tcode{V}
|
6401 |
| -is sequenced before |
| 6412 | +strongly happens before |
6402 | 6413 | the initialization of \tcode{W}.
|
6403 | 6414 | \end{itemize}
|
6404 | 6415 |
|
|
0 commit comments