D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22894 - importC: static struct initializer can't take address of own field
Summary: importC: static struct initializer can't take address of own field
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-03-18 04:49 UTC by duser
Modified: 2022-03-24 18:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description duser 2022-03-18 04:49:51 UTC
struct queue
{
	int *first;
	int **last;
};
struct queue my_queue = {
	0,
	&my_queue.first
};

Error: static variable `my_queue` cannot be read at compile time
Comment 1 Dlang Bot 2022-03-24 06:22:11 UTC
@WalterBright created dlang/dmd pull request #13881 "fix Issue 22894 - importC: static struct initializer can't take addre…" fixing this issue:

- fix Issue 22894 - importC: static struct initializer can't take address of own field

https://github.com/dlang/dmd/pull/13881
Comment 2 Dlang Bot 2022-03-24 18:32:24 UTC
dlang/dmd pull request #13881 "fix Issue 22894 - importC: static struct initializer can't take addre…" was merged into master:

- de15dc91c982cb1932843f31e5b4ee10b14463d1 by Walter Bright:
  fix Issue 22894 - importC: static struct initializer can't take address of own field

https://github.com/dlang/dmd/pull/13881