www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19730] New: if (auto x) {} isn't properly rejected

https://issues.dlang.org/show_bug.cgi?id=19730

          Issue ID: 19730
           Summary: if (auto x) {} isn't properly rejected
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

```
void func() {
  bool x;
  if (auto x) {}
}
```
This is accepted as valid code, but it should not be. It is currently treated
as if the auto is not present.

The last version to correctly reject this was DMD 2.062.

--
Mar 11 2019