Skip to content

Fix #4938 - Be stricter wrt. supported AddrExp in toConstElem() #4939

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: master
Choose a base branch
from

Conversation

kinke
Copy link
Member

@kinke kinke commented May 24, 2025

DMD seems to support AddrExp of struct literals only...

@@ -401,7 +401,7 @@ class ToConstElemVisitor : public Visitor {
return;
}

// address of indexExp
/* address of indexExp
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[for now just checking whether we hit this case anywhere in the testsuite]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, these are apparently represented as SymOffExp:

shared int[3] arr;

auto e = &arr[1];
auto bla = &arr;

…stElem()

DMD seems to support AddrExp of struct literals only...
@kinke kinke marked this pull request as ready for review May 24, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant