digitalmars.D.bugs - struct and === Internal error: ..\ztc\cgcs.c 353
- Ben Hinkle (19/19) Feb 28 2005 struct foo {
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (34/34) Mar 12 2005 -----BEGIN PGP SIGNED MESSAGE-----
struct foo {
int opEquals(foo x) {
return this.normalize === x.normalize;
}
foo normalize() {
foo res;
return res;
}
}
int main() {
return 0;
}
The above example produces on windows dmd-0.114:
Internal error: ..\ztc\cgcs.c 353
It compiles if instead of using the normalize function the body of opEquals
is
return *this === x;
so it looks like the return values from the functions are confusing the ===
operator. It doesn't matter if foo has any data members.
Feb 28 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ben Hinkle wrote:
| struct foo {
| int opEquals(foo x) {
| return this.normalize === x.normalize;
| }
| foo normalize() {
| foo res;
| return res;
| }
| }
| int main() {
| return 0;
| }
|
| The above example produces on windows dmd-0.114:
|
| Internal error: ..\ztc\cgcs.c 353
|
| It compiles if instead of using the normalize function the body of
| opEquals is
| return *this === x;
| so it looks like the return values from the functions are confusing
| the === operator. It doesn't matter if foo has any data members.
Added to DStress as
http://dstress.kuehne.cn/run/bug_cgcs_353_C.d
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFCMrvJ3w+/yD4P9tIRAtCxAJ0QlfPDdoCnRyK1dFlEIRku6xQ2EgCfRLDG
Fj1lCOy0heF8XPqjb1AXvw4=
=JPcQ
-----END PGP SIGNATURE-----
Mar 12 2005








=?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?=