Bug 24383 – Index assignment expression in __traits(compiles) fails to parse

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-02-10T05:57:47Z
Last change time
2024-02-13T16:16:57Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus

Comments

Comment #0 by snarwin+bugzilla — 2024-02-10T05:57:47Z
As of DMD 2.107.0, the following program fails to compile: --- enum _ = __traits(compiles, a[0] = 0); --- The error message is: --- bug.d(1): Error: found `=` when expecting `)` following template argument list bug.d(1): Error: semicolon expected following auto declaration, not `0` bug.d(1): Error: declaration expected, not `0` --- This is clearly an error in the parser. There is no template in this program, so it should not be parsing a template argument list.
Comment #1 by dlang-bot — 2024-02-10T16:16:45Z
@ntrel created dlang/dmd pull request #16172 "Fix Bugzilla 24383 - Index assignment expression in __traits(compiles…" fixing this issue: - Fix Bugzilla 24383 - Index assignment expression in __traits(compiles) fails to parse https://github.com/dlang/dmd/pull/16172
Comment #2 by dlang-bot — 2024-02-13T16:16:57Z
dlang/dmd pull request #16172 "Fix Bugzilla 24383 - Index assignment expression in __traits(compiles…" was merged into master: - 370ab649bdbf34db9a31c6875d317a64357b78c3 by Nick Treleaven: Fix Bugzilla 24383 - Index assignment expression in __traits(compiles) fails to parse https://github.com/dlang/dmd/pull/16172