[Issue 23034] New: importC: head-const struct confused with multiple files on command line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 18 00:23:04 UTC 2022


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

          Issue ID: 23034
           Summary: importC: head-const struct confused with multiple
                    files on command line
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: duser at neet.fi
                CC: duser at neet.fi

// file1.c
struct S1 {
        int field1;
};
struct S1 *const unused;

// file2.c
struct S2 {
        int field2;
};
void fn()
{
        struct S2 *const s;
        int x = s->field2; // here
}

compile: dmd file1.c file2.c

file2.c(7): Error: `field2` is not a member of `const(S1)`

similar to issue 23030 but not caused by the same PR (this exists on stable
v2.099.1 too)

--


More information about the Digitalmars-d-bugs mailing list