Skip to content

Commit 7756db9

Browse files
jensmaurerzygoloid
authored andcommitted
[expr.unary.op] Use bullets to clarify the address-of operator.
Also cover the missed case of a prvalue qualified-id.
1 parent 5c5570d commit 7756db9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/expressions.tex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,11 +4151,13 @@
41514151
\indextext{name!address of cv-qualified}%
41524152
\indextext{expression!pointer-to-member constant}%
41534153
The result of the unary \tcode{\&} operator is a pointer to its operand.
4154-
The operand shall be an lvalue or a \grammarterm{qualified-id}.
4154+
\begin{itemize}
4155+
\item
41554156
If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m}
41564157
of some class \tcode{C} with type \tcode{T}, the result has type ``pointer to member
41574158
of class \tcode{C} of type \tcode{T}'' and is a prvalue designating \tcode{C::m}.
4158-
Otherwise, if the type of the expression is \tcode{T}, the result has type ``pointer to
4159+
\item
4160+
Otherwise, if the operand is an lvalue of type \tcode{T}, the result has type ``pointer to
41594161
\tcode{T}'' and is a prvalue that is the address of the designated object\iref{intro.memory}
41604162
or a pointer to the designated function. \begin{note} In particular, the address of an
41614163
object of type ``\cv{}~\tcode{T}'' is ``pointer to \cv{}~\tcode{T}'', with the same
@@ -4165,8 +4167,10 @@
41654167
an object that is not an array element whose
41664168
address is taken in this way is considered to belong to an array with one
41674169
element of type \tcode{T}.
4170+
\item
4171+
Otherwise, the program is ill-formed.
4172+
\end{itemize}
41684173
\begin{example}
4169-
41704174
\begin{codeblock}
41714175
struct A { int i; };
41724176
struct B : A { };

0 commit comments

Comments
 (0)