D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23044 - importC: comma expression with function call parsed as declaration
Summary: importC: comma expression with function call parsed as declaration
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ImportC, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2022-04-21 23:38 UTC by duser
Modified: 2022-05-05 21:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description duser 2022-04-21 23:38:35 UTC
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 Walter Bright 2022-04-23 06:52:13 UTC
This is another problem where the root issue is C mixes up semantics with parsing.
Comment 2 Dlang Bot 2022-04-23 07:05:36 UTC
@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 Dlang Bot 2022-04-25 14:13:28 UTC
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 Dlang Bot 2022-05-05 21:04:17 UTC
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