// file main.d
struct Foo
{
// Use one of these lines at a time
//float x; // OK
float x,y; // ERROR
//float[0] x; // OK
//float[1] x; // OK
//float[2] x; // ERROR
//float[3] x; // ERROR
//int x; // OK
//int x,y; // ERROR
//int[2] x; // ERROR
//char x; // OK
//char x,y; // OK !!
//char[2] x; // OK !!
//dchar x,y; // ERROR
//dchar[2] x; // ERROR
}
void bar(Foo f)
{
asm
{
// bug seems to arise whenever 'offsetof f' is used
mov EAX, offsetof f;
}
}
---------------
$ dmd main.d
Internal error: ../ztc/cod3.c 2651
This error seems to arise whenever the struct has more than one "field" (either as real variable field or even as array), but interestingly it works for char.
'f' has to be a parameter, it compiles fine when declared as a global or local var.
Comment #1 by snake.scaly — 2008-08-28T15:24:57Z
The error also arises in case of:
char x,y,a,b,c; // ERROR
real x; // ERROR
That is, when Foo.sizeof > 4.
Comment #2 by bugzilla — 2008-08-29T00:30:39Z
Don't worry, I'll have that one fixed in the next update.