Bug 22068 – importC: cast-expression accepted as lvalue in unary-expression
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-22T14:00:50Z
Last change time
2021-06-23T15:04:15Z
Keywords
accepts-invalid, ImportC, pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2021-06-22T14:00:50Z
This isn't valid as per C11 6.5.3:
---
++(int)i;
The grammar is:
---
unary-expression:
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
sizeof unary-expression
sizeof ( type-name )
_Alignof ( type-name )
---
Similar to issue 22067, except here the parser not implementing the grammar correctly bites us even harder. In the former issue, it's likely an going to be an error deferred to semantic.
Comment #1 by dlang-bot — 2021-06-22T14:14:39Z
@ibuclaw created dlang/dmd pull request #12733 "fix Issue 22068 - importC: cast-expression accepted as lvalue in unary-expression" fixing this issue:
- fix Issue 22068 - importC: cast-expression accepted as lvalue in unary-expression
https://github.com/dlang/dmd/pull/12733
Comment #2 by dlang-bot — 2021-06-23T15:04:15Z
dlang/dmd pull request #12733 "fix Issue 22068 - importC: cast-expression accepted as lvalue in unary-expression" was merged into master:
- 4b19dde2beb88b8c8f3d80ba0990ae53a664d4e7 by Iain Buclaw:
fix Issue 22068 - importC: cast-expression accepted as lvalue in unary-expression
https://github.com/dlang/dmd/pull/12733