www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7184] New: parse error on *(x)++

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

           Summary: parse error on *(x)++
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



void main(){
    int[2] y;
    int *x = y.ptr;
    *(x)++=0;
}

Error: expression expected, not '='
Error: C style cast illegal, use cast(x)++0
Error: found '0' when expecting ';' following statement

The code should compile.




Workaround if parentheses are a result of code generation:

void main(){
    int[2] y;
    int *x = y.ptr;
    *(*&x)++=0;
}

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