Bug 2981 – Bad code generation for structs containing invariants
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2009-05-15T11:19:00Z
Last change time
2015-06-09T01:26:26Z
Keywords
wrong-code
Assigned to
nobody
Creator
sean
Comments
Comment #0 by sean — 2009-05-15T11:19:43Z
The addresses output in this test case should match:
import core.stdc.stdio;
struct S
{
this( string name )
{
printf( "(ctor) &%.*s.x = %p\n", name, &x );
}
invariant() {}
int x;
}
void main()
{
auto s = new S("s2");
printf( "&s2.x = %p\n", &s.x );
}