-
Notifications
You must be signed in to change notification settings - Fork 789
Closed
Description
http://eel.is/c++draft/expr.unary.op#3.sentence-4:
Otherwise, if the type of the expression is T, the result has type “pointer to T” and is a prvalue that is the address of the designated object ([intro.memory]) or a pointer to the designated function.
- «The result of a prvalue is the value that the expression stores into its context.» ([basic.lval]). The lvalue can be of type
T
, but denote an object of typeU
, so the type of the result of applying the address-of operator to it will bepointer to U
, notpointer to T
(and I'm unsure if we even can talk about the type of the result. The result is "pointer to object", the type of the prvalue ispointer to T
, but I don't think this makes sense to say that the type of the result ispointer to U
).pointer to T
is the type of the prvalue, not its result. - the prvalue has the value "pointer to the designated object or function", not "the address of the designated object or a pointer to the designated function."
The note following the sentence above (http://eel.is/c++draft/expr.unary.op#3.note-1) also needs a fix:
In particular, the address of an object of type “cv T” is “pointer to cv T”
I don't think that addresses have types.
Metadata
Metadata
Assignees
Labels
No labels