[Issue 24867] Wrong deprecation warning of @system variable usage under CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 19 15:21:34 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24867

--- Comment #1 from Luís Ferreira <contact at lsferreira.net> ---
Sorry, example is also wrong. Consider the following:

```
align(1) struct Bar {
        align(1): 
    const char* name;
    int b = 2;
}

struct Foo {
    static immutable Bar bar = Bar("foo");

    @safe
    void foo()
    {
        static assert(bar.b == 2);
    }
}
```

--


More information about the Digitalmars-d-bugs mailing list