Skip to content

Commit

Permalink
[class.static.data] Cleanup description for local/unnamed classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensmaurer authored and zygoloid committed Jan 13, 2020
1 parent 35641b4 commit 3b41755
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2791,6 +2791,12 @@
\tcode{thread_local} there is one copy of the data member that is shared by all
the objects of the class.

\pnum
A static data member shall not be \tcode{mutable}\iref{dcl.stc}.
A static data member shall not be a direct member\iref{class.mem}
of an unnamed\iref{class.pre} or local\iref{class.local} class or
of a (possibly indirectly) nested class\iref{class.nest} thereof.

\pnum
\indextext{initialization!static member}%
\indextext{definition!static member}%
Expand Down Expand Up @@ -2858,25 +2864,17 @@
There is exactly one definition of a static data member
that is odr-used\iref{basic.def.odr} in a valid program.
\end{note}
Unnamed classes and classes contained directly
or indirectly within unnamed classes shall not contain static
data members.

\pnum
\begin{note}
Static data members of a class in namespace scope have the linkage of the name of the class\iref{basic.link}.
A local class cannot have static data members\iref{class.local}.
\end{note}

\pnum
Static data members are initialized and destroyed exactly like
non-local variables~(\ref{basic.start.static}, \ref{basic.start.dynamic},
\ref{basic.start.term}).

\pnum
A static data member shall not be
\tcode{mutable}\iref{dcl.stc}.

\rSec2[class.bit]{Bit-fields}%
\indextext{bit-field}

Expand Down Expand Up @@ -3403,7 +3401,9 @@

\pnum
\indextext{restriction!static member local class}%
A local class shall not have static data members.
\begin{note}
A local class cannot have static data members\iref{class.static.data}.
\end{note}

\rSec1[class.derived]{Derived classes}%
\indextext{derived class|(}
Expand Down

0 comments on commit 3b41755

Please sign in to comment.