www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 452] New: Struct initialization fails with compiler assertion

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

           Summary: Struct initialization fails with compiler assertion
           Product: D
           Version: 0.172
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: wbaxter gmail.com


The code snippet below gives me a compiler error with DMD 0.172.

| > dmd atest.d
| Assertion failure: '0' on line 219 in file 'init.c'
| abnormal program termination

------------atest.d------------
struct Foo
{
    int a;
    int b;
}

void main()
{
    Foo x = {1,2};
}


I take it I'm not allowed to use initializers except for 'static' variables, so
it's a mistake in my code.  Still that shouldn't cause a runtime assertion in
the compiler.  A proper error like "initialization of non-static struct not
allowed" would be more useful.


-- 
Oct 24 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=452


braddr puremagic.com changed:

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




------- Comment #1 from braddr puremagic.com  2006-10-24 14:10 -------


*** This bug has been marked as a duplicate of 378 ***


-- 
Oct 24 2006