```
@safe:
struct T { int* a,b,c; }
void bar(void[24]);
void gee(void*);
void test() {
static T t;
gee(&t); // no error
bar(cast(void[24])t); // cast from `T` to `void[24]` not allowed in safe code
}
```
Both should be allowed or both should error.
Comment #1 by alphaglosined — 2024-11-18T19:00:06Z
Due to placement new, I'm on the side of disallowing conversion to ``void*`` and ``void[]`` in ``@safe``.
We have been relying on a language feature like that not existing and it opens up a major can of worms to have it.
Related: https://issues.dlang.org/show_bug.cgi?id=24772
Comment #2 by robert.schadek — 2024-12-13T19:38:34Z