[Issue 8684] New: Missing ')' in argument list creates a sea of error messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 18 00:45:59 PDT 2012


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

           Summary: Missing ')' in argument list creates a sea of error
                    messages
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2012-09-18 00:46:40 PDT ---
int foo(int n, int m)
{
    int x = foo( 5, m;
    for (int q=0; q<10; ++q){
       ++q;
    }
    return  2;
}

The error is a single missing ')'. But the compiler spits an error for each
extra token in the file. Probably, as soon as it hits an unexpected ;, it
should assume that it has reached the end of the argument list.
In reality this situation often happens in situations where the last parameter
is a function call, and parentheses are mismatched:
foo(5, foo(3, foo(7,6));

----------
r.d(4): Error: found ';' when expecting ',' following argument
r.d(5): Error: expression expected, not 'for'
r.d(5): Error: found 'q' when expecting '.' following int
r.d(5): Error: found '=' when expecting identifier following 'int.'
r.d(5): Error: found '0' when expecting ',' following argument
r.d(5): Error: expression expected, not ';'
r.d(5): Error: found 'q' when expecting ',' following argument
r.d(5): Error: expression expected, not '<'
r.d(5): Error: found '10' when expecting ',' following argument
r.d(5): Error: expression expected, not ';'
r.d(5): Error: found 'q' when expecting ',' following argument
r.d(5): Error: expression expected, not ')'
r.d(5): Error: found '{' when expecting ',' following argument
r.d(6): Error: found ';' when expecting ',' following argument
r.d(7): Error: expression expected, not '}'
r.d(8): Error: found 'return' when expecting ',' following argument
r.d(8): Error: found ';' when expecting ',' following argument
r.d(9): Error: expression expected, not '}'
r.d(12): Error: found 'EOF' when expecting ',' following argument
r.d(12): Error: found 'EOF' when expecting ')' following argument list

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


More information about the Digitalmars-d-bugs mailing list