D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15756 - reading wrong address for alias in nested struct instance
Summary: reading wrong address for alias in nested struct instance
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-04 14:09 UTC by John Colvin
Modified: 2020-03-21 03:56 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 John Colvin 2016-03-04 14:09:19 UTC
void main()
{
	import std.stdio;
	long a = 4;
	writeln(a);  // 4
	writeln(&a); // 7FBFE6BAA0

	struct Blah
	{
		alias b = a;
	}
	Blah blah;

	writeln(Blah.b);    // 4
	writeln(&(Blah.b)); // 7FBFE6BAA0
	writeln(blah.b);    // 1075983360
	writeln(&(blah.b)); // 7FBFE6BAA8
}