Bug 710 – compiler assertion failure w/ templates

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2006-12-22T05:04:00Z
Last change time
2014-02-15T13:21:43Z
Assigned to
bugzilla
Creator
ddaglas

Comments

Comment #0 by ddaglas — 2006-12-22T05:04:14Z
The following code: static int _i=0; template NEXT(int idx) { const NEXT = idx; } interface Protocol { static ubyte HELO = NEXT!(_i++); } void main() { } causes the Win32 dmd compiler to error with the following: C:\>dmd z.d global.errors = 0, gag = 0 00936D54 ++ type=int e1=00962524 e2=00936D78 00962524 var var=_i type=int 00936D78 1 type=int Assertion failure: '0' on line 775 in file 'expression.c' abnormal program termination --- errorlevel 1
Comment #1 by thomas-dloop — 2006-12-26T08:31:25Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-12-22: > http://d.puremagic.com/issues/show_bug.cgi?id=710 > The following code: > > static int _i=0; > > template NEXT(int idx) { > const NEXT = idx; > } > > interface Protocol { > static ubyte HELO = NEXT!(_i++); > } > > void main() { } > > causes the Win32 dmd compiler to error with the following: > > C:\>dmd z.d > global.errors = 0, gag = 0 > 00936D54 ++ type=int e1=00962524 e2=00936D78 > 00962524 var var=_i type=int > 00936D78 1 type=int > Assertion failure: '0' on line 775 in file 'expression.c' > > abnormal program termination old test cases triggering this bug: http://dstress.kuehne.cn/nocompile/t/template_30_A.d http://dstress.kuehne.cn/nocompile/t/template_30_B.d http://dstress.kuehne.cn/nocompile/t/template_30_C.d http://dstress.kuehne.cn/nocompile/t/template_30_D.d http://dstress.kuehne.cn/nocompile/t/template_30_E.d Added to DStress as http://dstress.kuehne.cn/nocompile/t/template_52_A.d http://dstress.kuehne.cn/nocompile/t/template_52_B.d http://dstress.kuehne.cn/nocompile/t/template_52_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFkRVfLK5blCcjpWoRApmlAKCDwuIf+Bir4HdhOYttjgVEzDRhjwCfYtzj M4+AgaYSuepXbre+GDxIgm0= =f07X -----END PGP SIGNATURE-----
Comment #2 by thomas-dloop — 2007-01-01T15:21:40Z
fixed in DMD-0.178