Skip to content

Commit f6bf643

Browse files
eisenwavetkoeppe
authored andcommitted
CWG3109 Access checking when designating a protected member by a splice
1 parent 86619b3 commit f6bf643

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

source/classes.tex

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,7 +5179,8 @@
51795179
\pnum
51805180
An additional access check beyond those described earlier in \ref{class.access}
51815181
is applied when a non-static data member or non-static member function is a
5182-
protected member of its designating class\iref{class.access.base}.
5182+
protected member of its designating class\iref{class.access.base}
5183+
and is not designated by a \grammarterm{splice-expression}.
51835184
\begin{footnote}
51845185
This
51855186
additional check does not apply to other members,
@@ -5188,9 +5189,11 @@
51885189
As described earlier, access to a protected member is granted because the
51895190
reference occurs in a friend or direct member of some class \tcode{C}. If the access is
51905191
to form a pointer to member\iref{expr.unary.op}, the
5191-
\grammarterm{nested-name-specifier} shall denote \tcode{C} or a class derived from
5192-
\tcode{C}. All other accesses involve a (possibly implicit) object
5193-
expression\iref{expr.ref}. In this case, the class of the object expression shall be
5192+
\grammarterm{nested-name-specifier} shall designate \tcode{C} or a class derived from
5193+
\tcode{C}.
5194+
Otherwise, if the access involves a (possibly implicit)
5195+
object expression\iref{expr.prim.id.general,expr.ref},
5196+
the class of the object expression shall be
51945197
\tcode{C} or a class derived from \tcode{C}.
51955198
\begin{example}
51965199
\begin{codeblock}

0 commit comments

Comments
 (0)