[Issue 24383] New: Index assignment expression in __traits(compiles) fails to parse
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 10 05:57:47 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24383
Issue ID: 24383
Summary: Index assignment expression in __traits(compiles)
fails to parse
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list