File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 41514151\indextext {name!address of cv-qualified}%
41524152\indextext {expression!pointer-to-member constant}%
41534153The 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
41554156If the operand is a \grammarterm {qualified-id} naming a non-static or variant member \tcode {m}
41564157of some class \tcode {C} with type \tcode {T}, the result has type `` pointer to member
41574158of 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 }
41604162or a pointer to the designated function. \begin {note } In particular, the address of an
41614163object of type `` \cv {}~\tcode {T}'' is `` pointer to \cv {}~\tcode {T}'' , with the same
41654167an object that is not an array element whose
41664168address is taken in this way is considered to belong to an array with one
41674169element of type \tcode {T}.
4170+ \item
4171+ Otherwise, the program is ill-formed.
4172+ \end {itemize }
41684173\begin {example }
4169-
41704174\begin {codeblock }
41714175struct A { int i; };
41724176struct B : A { };
You can’t perform that action at this time.
0 commit comments