September 10, 2014 [Issue 13455] New: Side effects of comma operator not evaluated for empty 'expression tuple' right hand side | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=13455 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!()); writeln(i); assert(i==1); } -- |
Copyright © 1999-2021 by the D Language Foundation