Skip to content

Commit 3b41755

Browse files
jensmaurerzygoloid
authored andcommitted
[class.static.data] Cleanup description for local/unnamed classes.
1 parent 35641b4 commit 3b41755

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

source/classes.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,12 @@
27912791
\tcode{thread_local} there is one copy of the data member that is shared by all
27922792
the objects of the class.
27932793

2794+
\pnum
2795+
A static data member shall not be \tcode{mutable}\iref{dcl.stc}.
2796+
A static data member shall not be a direct member\iref{class.mem}
2797+
of an unnamed\iref{class.pre} or local\iref{class.local} class or
2798+
of a (possibly indirectly) nested class\iref{class.nest} thereof.
2799+
27942800
\pnum
27952801
\indextext{initialization!static member}%
27962802
\indextext{definition!static member}%
@@ -2858,25 +2864,17 @@
28582864
There is exactly one definition of a static data member
28592865
that is odr-used\iref{basic.def.odr} in a valid program.
28602866
\end{note}
2861-
Unnamed classes and classes contained directly
2862-
or indirectly within unnamed classes shall not contain static
2863-
data members.
28642867

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

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

2876-
\pnum
2877-
A static data member shall not be
2878-
\tcode{mutable}\iref{dcl.stc}.
2879-
28802878
\rSec2[class.bit]{Bit-fields}%
28812879
\indextext{bit-field}
28822880

@@ -3403,7 +3401,9 @@
34033401

34043402
\pnum
34053403
\indextext{restriction!static member local class}%
3406-
A local class shall not have static data members.
3404+
\begin{note}
3405+
A local class cannot have static data members\iref{class.static.data}.
3406+
\end{note}
34073407

34083408
\rSec1[class.derived]{Derived classes}%
34093409
\indextext{derived class|(}

0 commit comments

Comments
 (0)