www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13455] New: Side effects of comma operator not evaluated for


          Issue ID: 13455
           Summary: Side effects of comma operator not evaluated for empty
                    'expression tuple' right hand side
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: timon.gehr gmx.ch

The following code compiles and runs with failing assertions with DMD 2.066.0,
but it should compile and run with both assertions passing.

import std.stdio;
alias Seq(T...)=T;
int line;
void fun(T...)(T args,Seq!() x=(line=__LINE__,Seq!().init)){
    writeln("args: ",args,"\nline: ",line);
void main(){
    fun(2,"123"); assert(line==__LINE__);
    int i=0;
    auto x=(i++,Seq!());

Sep 10 2014