November 27, 2015 [Issue 15384] New: assignment is sometimes still accepted as a condition | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15384 Issue ID: 15384 Summary: assignment is sometimes still accepted as a condition Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity: minor Priority: P3 Component: dmd Assignee: nobody@puremagic.com Reporter: eponymousalias@yahoo.com Problem seen with: DMD64 D Compiler v2.067.1 bool cond = true; do { // stuff } while (cond = false); yields: Error: assignment cannot be used as a condition, perhaps == was meant? But: bool cond = true; do { // stuff } while (cond = false, cond = false); passes the compiler without complaint, even though it also uses an assignment as a condition. -- |
Copyright © 1999-2021 by the D Language Foundation