[Issue 24866] New: Inconsistent behavior in safe checking of conversion to void

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 18 18:36:48 UTC 2024


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

          Issue ID: 24866
           Summary: Inconsistent behavior in safe checking of conversion
                    to void
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

```
@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.

--


More information about the Digitalmars-d-bugs mailing list