www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6710] New: Can't use .sizeof in pragma(msg) call

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6710

           Summary: Can't use .sizeof in pragma(msg) call
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



20:50:04 PDT ---
struct Foo
{
    static assert(Foo.sizeof == 4);  // ok
    pragma(msg, Foo.sizeof);  // Error: struct test.Foo no size yet for forward
reference

    int x;
}

void main() { }

I'm not sure if it's genuinely a bug, IOW maybe the pragma is evaluated before
the compiler does a pass to see which fields the struct is holding?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 21 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6710




06:56:49 PST ---
Workaround: Put the pragma call outside of the structure definition.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6710


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



18:48:26 PDT ---
Fixed in 2.059, don't know by which commit though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012