Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1063,24 +1063,29 @@
\tcode{T}'', where \tcode{B} is a class type, can be converted to
a prvalue of type ``pointer to member of \tcode{D} of type \cv{}
\tcode{T}'', where \tcode{D} is a complete class derived\iref{class.derived}
from \tcode{B}. If \tcode{B} is an
inaccessible\iref{class.access},
from \tcode{B}, as follows:
\begin{itemize}
\item
If \tcode{B} is an inaccessible\iref{class.access},
ambiguous\iref{class.member.lookup}, or virtual\iref{class.mi} base
class of \tcode{D}, or a base class of a virtual base class of
\tcode{D}, a program that necessitates this conversion is ill-formed.
If class \tcode{D} does not contain the original member and
\item
Otherwise, if the operand is the null member pointer value,
the result is the null member pointer value of the destination type.
\item
Otherwise, if class \tcode{D} does not contain the original member and
is not a base class of the class containing the original member,
the behavior is undefined. Otherwise,
the result of the conversion refers to the same member as the pointer to
the behavior is undefined.
\item
Otherwise, the result of the conversion refers to the same member as the pointer to
member before the conversion took place, but it refers to the base class
member as if it were a member of the derived class. The result refers to
the member in \tcode{D}'s instance of \tcode{B}. Since the result has
type ``pointer to member of \tcode{D} of type \cv{} \tcode{T}'',
indirection through it with a \tcode{D} object is valid. The result is the same
as if indirecting through the pointer to member of \tcode{B} with the
\tcode{B} subobject of \tcode{D}. The null member pointer value is
converted to the null member pointer value of the destination
type.
\tcode{B} subobject of \tcode{D}.
\begin{footnote}
The rule for conversion of pointers to members (from pointer to member
of base to pointer to member of derived) appears inverted compared to
Expand All @@ -1094,6 +1099,7 @@
In particular, a pointer to member cannot be converted to a
\tcode{\keyword{void}*}.
\end{footnote}
\end{itemize}

\rSec2[conv.fctptr]{Function pointer conversions}

Expand Down
Loading