April 08, 2021
https://issues.dlang.org/show_bug.cgi?id=21811

          Issue ID: 21811
           Summary: Unable to use IfCondition as expression in while
                    statement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: mrjnewt@gmail.com

According to the language spec, a while loop takes an IfCondition as its expression.  IfConditions allow introducing a variable and assigning it but this does not actually parse in the context of a WhileStatement.  The documentation for the WhileStatement explicitly mentions introducing a variable with auto as subpoint #3.

WhileStatement: https://dlang.org/spec/statement.html#while-statement IfCondition: https://dlang.org/spec/statement.html#IfCondition

Sample repro which fails to compile: https://run.dlang.io/is/VGwtDT

--