Skip to content

Commit 86bf74a

Browse files
committed
CWG3109 Access checking when designating a protected member by a splice
1 parent 0aa1b4c commit 86bf74a

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
@@ -5177,7 +5177,8 @@
51775177
\pnum
51785178
An additional access check beyond those described earlier in \ref{class.access}
51795179
is applied when a non-static data member or non-static member function is a
5180-
protected member of its designating class\iref{class.access.base}.
5180+
protected member of its designating class\iref{class.access.base}
5181+
and is not designated by a \grammarterm{splice-expression}.
51815182
\begin{footnote}
51825183
This
51835184
additional check does not apply to other members,
@@ -5186,9 +5187,11 @@
51865187
As described earlier, access to a protected member is granted because the
51875188
reference occurs in a friend or direct member of some class \tcode{C}. If the access is
51885189
to form a pointer to member\iref{expr.unary.op}, the
5189-
\grammarterm{nested-name-specifier} shall denote \tcode{C} or a class derived from
5190-
\tcode{C}. All other accesses involve a (possibly implicit) object
5191-
expression\iref{expr.ref}. In this case, the class of the object expression shall be
5190+
\grammarterm{nested-name-specifier} shall designate \tcode{C} or a class derived from
5191+
\tcode{C}.
5192+
Otherwise, if the access involves a (possibly implicit)
5193+
object expression\iref{expr.prim.id.general,expr.ref},
5194+
the class of the object expression shall be
51925195
\tcode{C} or a class derived from \tcode{C}.
51935196
\begin{example}
51945197
\begin{codeblock}

0 commit comments

Comments
 (0)