Bug 23044 – importC: comma expression with function call parsed as declaration

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-21T23:38:35Z
Last change time
2022-05-05T21:04:17Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-04-21T23:38:35Z
void other(int x){} void fn() { int x; other(x), x = 1; } test.c(5): Error: declaration `x` is already defined test.c(4): `variable` `x` is defined here test.c(5): Error: declaration `x` is already defined test.c(4): `variable` `x` is defined here
Comment #1 by bugzilla — 2022-04-23T06:52:13Z
This is another problem where the root issue is C mixes up semantics with parsing.
Comment #2 by dlang-bot — 2022-04-23T07:05:36Z
@WalterBright created dlang/dmd pull request #14023 "fix Issue 23044 - importC: comma expression with function call parsed…" fixing this issue: - fix Issue 23044 - importC: comma expression with function call parsed as declaration https://github.com/dlang/dmd/pull/14023
Comment #3 by dlang-bot — 2022-04-25T14:13:28Z
dlang/dmd pull request #14023 "fix Issue 23044 - importC: comma expression with function call parsed…" was merged into stable: - 7a63edf2fbc6755ec52e4a61eba60520983096a8 by Walter Bright: fix Issue 23044 - importC: comma expression with function call parsed as declaration https://github.com/dlang/dmd/pull/14023
Comment #4 by dlang-bot — 2022-05-05T21:04:17Z
dlang/dmd pull request #14064 "merge stable" was merged into master: - 20ced85c32e9911663c9c1abd1ced14b95a6c0fd by Walter Bright: fix Issue 23044 - importC: comma expression with function call parsed as declaration (#14023) https://github.com/dlang/dmd/pull/14064