Skip to content

Commit a361843

Browse files
committed
CWG2458 Value category of expressions denoting non-static member functions
1 parent 4df64b4 commit a361843

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

source/expressions.tex

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,15 +1581,23 @@
15811581
\grammarterm{decltype-specifier} \tcode{::} \tcode{\~} \grammarterm{type-name}.
15821582

15831583
\pnum
1584-
The result of a \grammarterm{qualified-id} is
1584+
The result of a \grammarterm{qualified-id} $Q$ is
15851585
the entity it denotes\iref{basic.lookup.qual}.
15861586
The type of the expression is the type of the result.
15871587
The result is an lvalue if the member is
1588-
a function,
1588+
\begin{itemize}
1589+
\item
1590+
a function other than a non-static member function,
1591+
\item
1592+
a non-static member function
1593+
if $Q$ is the operand of a unary \tcode{\&} operator,
1594+
\item
15891595
a variable,
1590-
a structured binding\iref{dcl.struct.bind},
1591-
a static member function, or
1596+
\item
1597+
a structured binding\iref{dcl.struct.bind}, or
1598+
\item
15921599
a data member,
1600+
\end{itemize}
15931601
and a prvalue otherwise.
15941602

15951603
\rSec3[expr.prim.id.dtor]{Destruction}
@@ -4313,22 +4321,21 @@
43134321
\pnum
43144322
\indextext{name!address of cv-qualified}%
43154323
\indextext{expression!pointer-to-member constant}%
4316-
The result of the unary \tcode{\&} operator is a pointer to its operand.
4324+
The operand of the unary \tcode{\&} operator
4325+
shall be an lvalue of some type \tcode{T}.
4326+
The result is a prvalue.
43174327
\begin{itemize}
43184328
\item
43194329
If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m}
4320-
of some class \tcode{C} with type \tcode{T}, the result has type ``pointer to member
4321-
of class \tcode{C} of type \tcode{T}'' and is a prvalue designating \tcode{C::m}.
4330+
of some class \tcode{C}, the result has type ``pointer to member
4331+
of class \tcode{C} of type \tcode{T}'' and designates \tcode{C::m}.
43224332
\item
4323-
Otherwise, if the operand is an lvalue of type \tcode{T},
4324-
the resulting expression is a prvalue of type ``pointer to \tcode{T}''
4325-
whose result is a pointer to the designated object\iref{intro.memory} or function.
4333+
Otherwise, the result has type ``pointer to \tcode{T}'' and points to
4334+
the designated object\iref{intro.memory} or function\iref{basic.compound}.
43264335
\begin{note}
43274336
In particular, taking the address of a variable of type ``\cv{}~\tcode{T}''
43284337
yields a pointer of type ``pointer to \cv{}~\tcode{T}''.
43294338
\end{note}
4330-
\item
4331-
Otherwise, the program is ill-formed.
43324339
\end{itemize}
43334340
\begin{example}
43344341
\begin{codeblock}

0 commit comments

Comments
 (0)