www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20909] New: .offsetof fails on forward reference of field


          Issue ID: 20909
           Summary: .offsetof fails on forward reference of field
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: boris2.9 gmail.com

Test case:

struct S
    pragma(msg, x.sizeof);   // OK
    pragma(msg, x.offsetof); // Error
    int x;


test.d(4): Error: no property offsetof for type int
test.d(4):        while evaluating pragma(msg, x.offsetof)

Jun 08 2020