Bug 19730 – if (auto x) {} isn't properly rejected

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-11T23:53:26Z
Last change time
2020-03-21T03:56:43Z
Keywords
accepts-invalid, pull
Assigned to
No Owner
Creator
elpenguino+D

Comments

Comment #0 by elpenguino+D — 2019-03-11T23:53:26Z
``` 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.
Comment #1 by dlang-bot — 2019-03-12T02:11:09Z
@Basile-z created dlang/dmd pull request #9447 "[trivial] fix issue 19730 - if (auto x) {} isn't properly rejected" fixing this issue: - fix issue 19730 - if (auto x) {} isn't properly rejected https://github.com/dlang/dmd/pull/9447
Comment #2 by dlang-bot — 2019-03-12T23:25:35Z
dlang/dmd pull request #9447 "[trivial] fix issue 19730 - if (auto x) {} isn't properly rejected" was merged into stable: - 0f21ba04b42adbfbc3008fd1aec85be2c49dc298 by Basile Burg: fix issue 19730 - if (auto x) {} isn't properly rejected https://github.com/dlang/dmd/pull/9447