Skip to content
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

[0004] Update union spec to clarify casting behaviors #38

Open
llvm-beanz opened this issue Apr 12, 2023 · 0 comments
Open

[0004] Update union spec to clarify casting behaviors #38

llvm-beanz opened this issue Apr 12, 2023 · 0 comments
Assignees
Labels
active proposal Issues relating to active proposals
Milestone

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Apr 12, 2023

Which proposal does this relate to?
0004-unions

Describe the issue or outstanding question.
As per the discussion in #37, C++ union rules actually might not really be what we want for HLSL.

The C++ standard states the following in §9.5.1:

In a union, at most one of the non-static data members can be active at any time, that is, the value of at most one of the non-static data members can be stored in a union at any time. [...] The size of a union is sufficient to contain the largest of its non-static data members. Each non-static data member is allocated as if it were the sole member of a struct. All non-static data members of a union object have the same address.

We should elaborate the unions spec to clarify some of these behaviors one way or the other.

Additional context
vk::BufferPointer<T,A> review
Related vk::BufferPointer<T,A> issue

@llvm-beanz llvm-beanz self-assigned this Apr 12, 2023
@llvm-beanz llvm-beanz changed the title Update union spec to clarify casting behaviors [0004] Update union spec to clarify casting behaviors Apr 14, 2023
@llvm-beanz llvm-beanz added the active proposal Issues relating to active proposals label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active proposal Issues relating to active proposals
Projects
Status: Backlog
Development

No branches or pull requests

1 participant