[Issue 19730] New: if (auto x) {} isn't properly rejected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 11 23:53:26 UTC 2019


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 at puremagic.com
          Reporter: elpenguino+D at 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.

--


More information about the Digitalmars-d-bugs mailing list