www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Static array of struct/union can't forward reference

reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Using DMD 0.125, Windows 98SE.

----------
struct Qwert {
	Yuiop[27] asdfg;
}

struct Yuiop {
	int hjkl;
}
----------
D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
struct struct_array_forward.Yuiop no size yet for forward reference
D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
struct struct_array_forward.Yuiop no size yet for forward reference
D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
struct struct_array_forward.Yuiop no size yet for forward reference
----------

This only happens when you're declaring a static array of the 
forward-referenced struct.  It also happens if Yuiop is a union, but not 
if it's a class.

Also, it seems to happen only if the declaration is within a class, 
struct or union.  Declarations at module or function level don't show 
the bug.

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.
May 31 2005
parent Thomas Kuehne <thomas-dloop kuehne.this-is-spam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stewart Gordon schrieb am Tue, 31 May 2005 11:47:48 +0100:
 Using DMD 0.125, Windows 98SE.

 ----------
 struct Qwert {
 	Yuiop[27] asdfg;
 }

 struct Yuiop {
 	int hjkl;
 }
 ----------
 D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
 struct struct_array_forward.Yuiop no size yet for forward reference
 D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
 struct struct_array_forward.Yuiop no size yet for forward reference
 D:\My Documents\Programming\D\Tests\bugs\struct_array_forward.d(5): 
 struct struct_array_forward.Yuiop no size yet for forward reference
 ----------

 This only happens when you're declaring a static array of the 
 forward-referenced struct.  It also happens if Yuiop is a union, but not 
 if it's a class.

 Also, it seems to happen only if the declaration is within a class, 
 struct or union.  Declarations at module or function level don't show 
 the bug.
Adde to DStress as http://dstress.kuehne.cn/run/f/forward_reference_12_A.d http://dstress.kuehne.cn/run/f/forward_reference_12_B.d http://dstress.kuehne.cn/run/f/forward_reference_12_C.d http://dstress.kuehne.cn/run/f/forward_reference_12_D.d http://dstress.kuehne.cn/run/f/forward_reference_12_E.d http://dstress.kuehne.cn/run/f/forward_reference_12_F.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCo5dd3w+/yD4P9tIRAr6cAJ9QaGuYRbcoU5ea3izl56odF8UIqgCgtAeu KbDRJREt866X2TuBZPgCzV8= =WS+O -----END PGP SIGNATURE-----
Jun 05 2005