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

__rvalue does not work with __gshared globals #20619

Open
WalterBright opened this issue Dec 30, 2024 · 0 comments
Open

__rvalue does not work with __gshared globals #20619

WalterBright opened this issue Dec 30, 2024 · 0 comments

Comments

@WalterBright
Copy link
Member

WalterBright commented Dec 30, 2024

import core.stdc.stdio;

struct S4
{
    void* p;

    this(S4 s)
    {
        printf("this(S4) %p %p\n", &s, &x);
        assert(&s == &x); // confirm the rvalue reference
    }
}

__gshared S4 x;

void main()
{
    S4 t = __rvalue(x);
}

this should pass, but the __rvalue is ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant