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

           Summary: Last catch only accepts block statement
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bio...@free.fr


--- Comment #0 from biozic <bio...@free.fr> 2010-03-28 08:56:17 PDT ---
void main()
{
    try
        int i;
    catch (Exception e)
        int j;
    catch {
        int k;
    }

    try
        int i;
    catch (Exception e)
        int j;
    catch
        int k; // ERROR:: compiler expects (
}

A NoScopeNonEmptyStatement is expected after the last catch. Maybe this patch
can help solve the problem.

===================================================================
---  parse.c    (revision 422)
+++ parse.c    (working copy)
@@ -4064,11 +4064,11 @@ Statement *Parser::parseStatement(int fl
         Type *t;
         Identifier *id;
         Loc loc = this->loc;

         nextToken();
-        if (token.value == TOKlcurly)
+        if (token.value == TOKlcurly || token.value != TOKlparen)
         {
             t = NULL;
             id = NULL;
         }
         else

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

Reply via email to