http://d.puremagic.com/issues/show_bug.cgi?id=3605

           Summary: Compiler accepts invalid variable declaration, which
                    does not link
           Product: D
           Version: 2.036
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: michal.min...@gmail.com


--- Comment #0 from Michal Minich <michal.min...@gmail.com> 2009-12-11 02:55:08 
PST ---
1. struct, class and union type: Error 42: Symbol Undefined
_D4main4mainFZv1sMFZS4main2S2

struct S { int x; }
void main ()
{
   S s();  // braces should not be allowed.
   s.x = 1; // comment this line and example compiles and runs
}


2. int type: Error 42: Symbol Undefined _D4main4mainFZv1iMFZi

void main ()
{
    int i(); // braces should not be allowed.
    int a = i.max; // surprisingly this and next line works.
    writeln (a);
    //i = 1; // uncomment this to cause error
    //writeln (i); // or this
}


2b. this example works correctly – compiler gives some error message, even if
not so appropriate.
Error: function main.main.i () is not callable using argument types (int)
Error: expected 0 arguments, not 1 for non-variadic function type int()

void main ()
{
    int i();
    i = 1;
}

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

Reply via email to