Skip to content
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

[class.static.data] Cleanup description for local/unnamed classes. #3582

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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