Skip to content

Commit 3187ac9

Browse files
eisenwavetkoeppe
authored andcommitted
CWG3114 Indirect base classes for class member access with direct base class relationship
1 parent d737b63 commit 3187ac9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

source/expressions.tex

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4322,17 +4322,18 @@
43224322
whose value is the value of the enumerator.
43234323

43244324
\item
4325-
Otherwise, if \tcode{E2} designates a direct base class relationship $(D, B)$
4326-
and the type of \tcode{E1} is \cv{} \tcode{T},
4325+
Otherwise, if \tcode{E2} designates a direct base class relationship $(D, B)$ and
4326+
$D$ is either the cv-unqualified class type of \tcode{E1} or a base class thereof,
4327+
let \cv{} be the cv-qualification of the type of \tcode{E1}.
4328+
\tcode{E1} is implicitly converted to the type ``reference to \cv{}~\tcode{$D$}''
4329+
(where the reference is an lvalue reference if \tcode{E1} is an lvalue
4330+
and an rvalue reference otherwise) and
43274331
the expression designates the direct base class subobject of type $B$
4328-
of the object designated by \tcode{E1}.
4332+
of the object designated by the converted \tcode{E1}.
43294333
If \tcode{E1} is an lvalue,
43304334
then \tcode{E1.E2} is an lvalue;
43314335
otherwise, \tcode{E1.E2} is an xvalue.
4332-
The type of \tcode{E1.E2} is ``\cv{} \tcode{$B$}''.
4333-
\begin{note}
4334-
This can only occur in an expression of the form \tcode{e1.[:e2:]}.
4335-
\end{note}
4336+
The type of \tcode{E1.E2} is \cv{}~\tcode{$B$}.
43364337
\begin{example}
43374338
\begin{codeblock}
43384339
struct B {

0 commit comments

Comments
 (0)