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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugd...@yahoo.com.au




--- Comment #6 from Don <clugd...@yahoo.com.au>  2009-08-07 08:35:26 PDT ---
To remove the warning from empty statements:

PATCH:
statement.c, line 564 (DMD2)

-        if (!(result & BEfallthru) && !s->comeFrom())
+        if (!(result & BEfallthru) && !s->comeFrom() && !s->isEmpty())
        {
        s->warning("statement is not reachable");
        }

And then add this line to ExpStatement, in statement.h line 140:

    virtual int isEmpty() { return exp==NULL; }


Side effect: This will make {;;;;;} an empty statement; at the moment, it
isn't. The patch below makes the code below compile (into return 2;). Currently
it won't compile, but works if try{;} is changed into try{}.

nothrow int main() {
 int x= 2;
 try { ; } catch(Exception e) { x=4; throw new Exception("xxx"); } 
 return x;
}

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

Reply via email to