Skip to content

[dcl.array] The first element has the same address as the array #3203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

languagelawyer
Copy link
Contributor

This provides normative wording for the Note from [basic.compound]/4:

[ Note: An array object and its first element are not pointer-interconvertible, even though they have the same address.— end note ]

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Sep 18, 2019
@jensmaurer jensmaurer added cwg Issue must be reviewed by CWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Sep 30, 2019
@jensmaurer
Copy link
Member

Editorial teleconference: Send to CWG with given proposed resolution.

@languagelawyer
Copy link
Contributor Author

@frederick-vs-ja
Copy link
Contributor

Do we still need this given #4061 is merged? I think it's probably deducible from the current wording that the first element has the same address as the array.

@jensmaurer
Copy link
Member

Let's close this, then.

@jensmaurer jensmaurer closed this Jul 25, 2025
@languagelawyer
Copy link
Contributor Author

How did #4061 affect this? The concern about first element address is/was not due to padding

@frederick-vs-ja
Copy link
Contributor

Hmm, as it's clarified that there can't be paddings, I think it's already clear that the element at the lowest address has the same address as the array. Is there still possibility that element can be so arranged that the first element doesn't has the same address as the array?

@languagelawyer
Copy link
Contributor Author

languagelawyer commented Jul 28, 2025

it's already clear that the element at the lowest address has the same address as the array

If by "the lowest address" you mean the address represented by a pointer to the array object, then this is trivially true.

However, is this "element at the lowest address" the same object as "the first element of the array" (from [conv.array], which, I suppose, means array element 0 for the purposes of http://eel.is/c++draft/expr.add#4.2)?

@jensmaurer
Copy link
Member

[expr.rel] p4 might help.

@jensmaurer jensmaurer reopened this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy